• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[JASS] Local Variable Question

Status
Not open for further replies.
Level 6
Joined
Feb 15, 2005
Messages
183
ok, This is what I have right now.

-Actions-
Custom script: local unit Farmer
Custom script: local unit Maid
pickevery unit in uncits currently selected by player and do actions:
IF- Picked Unit = to Peasant
THEN- Custom script: set Farmer = GetEnumUnit()
ELSE- Custom script: set Maid = GetEnumUnit()
Pause Picked unit
{bunch of other crap happens that is irrelevant}
Custom script: call Pause UnitBJ (false, Get Farmer)
Custom script: call Pause UnitBJ (false, Get Maid


Now, the reason i need to make these 2 picked units a local variable, is because if the trigger is activated while a previous loop is trying to resolve, the previous paused units will remain paused forever, since the "picked unit" variable will be assigned to the new units.

So this is my problem, I am getting errors on my script stating errors such as "Expected a variable name" and "Expected a name". So If anyone has any ideas or could help me with fixing my custom scripts to get the job done, I would be very appreciative, thanks!
 
Level 1
Joined
Feb 6, 2005
Messages
4
You wrote:

Code:
Custom script: call Pause UnitBJ (false, Get Farmer) 
Custom script: call Pause UnitBJ (false, Get Maid

which has 3 errors it should be:

Code:
Custom script: call PauseUnitBJ (false,Farmer) 
Custom script: call PauseUnitBJ (false,Maid)

1. PauseUnitBJ is one term NO spaces

2. (false, Farmer) the Get should not be there, the syntax checker thinks you want a unit named "GetFarmer" which does not exist

3. (false,Maid) the ending bracket is very important

hope that helps :mrgreen:
 
Status
Not open for further replies.
Top