| 07-14-2006, 01:12 AM | #1 |
Hey, I have a spell that uses Drain Life, and if it kills the target unit, it will turn it into a ghoul. I was just messing around with this, but I found one problem. I had heard that triggers leak if you say something such as "Create a unit at position of (Non Pre-Placed Region)," so I decided to try to use this custom script instructed. But the WE says thier was an "Error" with my custom script once I tried to save it, so it turned off my code. Can someone tell me what is wrong with the custom script (I will just put the action, since it is all that is needed). Also, it said the following, if this helps. Highlighted the custom script with the text "Line 247: Invalid Argument Type" Trigger: Actions![]() Set Temp_Point=(Region centered at (Position of (Dying Unit)) with size (10.00,10.00))![]() Unit - Create 1 Ghoul - Level 1 for (Owner of (Killing unit)) at (Center of Temp_Point) facing Defailt building facing degreed![]() Custom script: call RemoveLocation (udg_Temp_Point)Thanks in advance to any replies. BTW, in this trigger, in the events/conditions, I just says, when a unit is finished casting an abiliity equal to Mind Rot (Spell name, ya, not very creative there), and the unit is equal to dead, go to actions. |
| 07-14-2006, 01:33 AM | #2 |
Set Temp_Point=(Region centered at (Position of (Dying Unit)) with size (10.00,10.00)) Error. A point isn't a region. Set Temp_Point=(Center of (Region centered at (Position of (Dying Unit)) with size (10.00,10.00))) That's better. Remove the "(Center of" in your unit creation action as well. Unit - Create 1 Ghoul - Level 1 for (Owner of (Killing unit)) at Temp_Point facing Defailt building facing degrees |
| 07-14-2006, 02:35 AM | #3 |
The point is the region, the center of the region is the point, with a width and hight of 10. I am using GUI for everything but the Custom Script, and it won't let me remove Center Of. It only makes sense to do that anyway though, because you are telling it where in that region to put that unit. It also all seemed to work, the only error was my custom script. |
| 07-14-2006, 05:07 AM | #4 |
A point is not a region, it doesn't have dimensions, and in principle consists of a x and y coordinate joined together within a variable. My guess is that your Temp_Point variable is of type region, when it should be of type point (or should it be location?, check on that). RemoveLocation doesn'0t work on regions. |
| 07-14-2006, 08:06 AM | #5 |
Oh yea, it is region, didn't know that. I will fix it tommorow and see what i come up with, thanks |
| 07-14-2006, 11:56 AM | #6 |
Hey... that ability can be done creating a custom ability based on parasite. change the unit produced by a ghoul and... that's all. No triggers are neccesary. |
| 07-14-2006, 07:01 PM | #7 |
It must Drain Life, then if it dies it creates a ghoul. Does parasite drain life ? |
