• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[JASS] Local Variable Question

Status
Not open for further replies.
Level 7
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