• 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.

[Trigger] Expected endif?

Status
Not open for further replies.
Level 3
Joined
Aug 15, 2007
Messages
67
I'm trying to fix a leak and have searched the forums found out how to and here is what I have...

Recreate on Death
Events
Unit - A unit Dies
Conditions
((Triggering unit) is Summoned) Equal to False
Actions
Wait 8.00 seconds
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Owner of (Dying unit)) Current lumber) Equal to 0
Then - Actions
Set SpawnPoint = (Random point in (Playable map area))
Unit - Create 1 Hero for (Triggering player) at SpawnPoint facing Default building facing degrees
Camera - Lock camera target for (Triggering player) to (Last created unit), offset by (0.00, 0.00) using Default rotation
Custom script: Call RemoveLocation(udg_SpawnPoint)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Owner of (Dying unit)) Current lumber) Equal to 1
Then - Actions
Set SpawnPoint = (Random point in (Playable map area))
Unit - Create 1 Hero2 for (Triggering player) at SpawnPoint facing Default building facing degrees
Camera - Lock camera target for (Triggering player) to (Last created unit), offset by (0.00, 0.00) using Default rotation
Custom script: Call RemoveLocation(udg_SpawnPoint)
Else - Actions

"Hero" and "Hero2" are put in place of the heroes name just for the site. It is a unit not a variable.

When I try to save the game it gives me the expected endif error.
Help please
 
Level 3
Joined
Aug 15, 2007
Messages
67
It is, this is what everyone says to use to fix leaks.

Set SpawnPoint = (Random point in (Playable map area))
Unit - Create 1 Hero for (Triggering player) at SpawnPoint facing Default building facing degrees
Camera - Lock camera target for (Triggering player) to (Last created unit), offset by (0.00, 0.00) using Default rotation
Custom script: Call RemoveLocation(udg_SpawnPoint)

I don't see the problem? If I use this I get an error and it wont play in wc3.
 
  • Recreate on Death
  • Events
  • Unit - A unit Dies
  • Conditions
  • ((Triggering unit) is Summoned) Equal to False
  • Actions
  • Wait 8.00 seconds
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
  • ((Owner of (Dying unit)) Current lumber) Equal to 0
  • Then - Actions
  • Set SpawnPoint = (Random point in (Playable map area))
  • Unit - Create 1 Hero for (Triggering player) at SpawnPoint facing Default building facing degrees
  • Camera - Lock camera target for (Triggering player) to (Last created unit), offset by (0.00, 0.00) using Default rotation
  • Custom script: Call RemoveLocation(udg_SpawnPoint)
  • Else - Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
  • ((Owner of (Dying unit)) Current lumber) Equal to 1
  • Then - Actions
  • Set SpawnPoint = (Random point in (Playable map area))
  • Unit - Create 1 Hero2 for (Triggering player) at SpawnPoint facing Default building facing degrees
  • Camera - Lock camera target for (Triggering player) to (Last created unit), offset by (0.00, 0.00) using Default rotation
  • Custom script: Call RemoveLocation(udg_SpawnPoint)
  • Else - Actions

Screenshot the error it gives you.
 
Level 3
Joined
Aug 15, 2007
Messages
67
The only thing I can think of is maybe SpawnPoint should not be a Point?

Here is ss.
 

Attachments

  • SS.GIF
    SS.GIF
    54.6 KB · Views: 383
Level 3
Joined
Aug 15, 2007
Messages
67
What about removing array variables?
I tried this but got Error Expected '('
  • Custom script: call RemoveLocation(udg_SpawnPoint[(Player numer of (Picked player))])
 
Level 8
Joined
Jul 23, 2005
Messages
329
A) You spelt number wrong

B) It should be:
  • Custom script: call RemoveLocation( udg_SpawnPoint[ GetConvertedPlayerId( GetEnumPlayer() ) ]
or something like that. JASS uses functions, not sentances.
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
Nah, he didn't. He solved one of them, then Yngwie brought up another. Preskool sort of answered it, but used a bj =/

By the way, kkots, he uses the variable to avoid leaks.

Besides, really, who cares? In alot of cases, other things can be pointed out other than the initial problem, and plus the initial answer can be improved (not in this case, since it wasn't a question of style, it was a typo)

kkots -- you can rotate the model with triggers, or make a new gate model. I have an edited "vertical gate" lying around somewhere on my computer.

However, please, in the future, make your own threads instead of hijacking other threads (unless your question relates to the topic of the thread)

Oh, by the way, here's the model (don't remember who made it, or if I did somehow):
 

Attachments

  • VerticalGate.mdx
    21.5 KB · Views: 179
Level 3
Joined
Aug 15, 2007
Messages
67
Thankyou everyone. What is a BJ? Using
  • Custom script: call RemoveLocation( udg_SpawnPoint[ GetConvertedPlayerId( GetEnumPlayer() ) ]
is bad? Also using this I get error ><
 
Level 3
Joined
Aug 15, 2007
Messages
67
I get this error.

btw sorry to be so much trouble >< and thankyou all for your help I really appreciate it!
 

Attachments

  • screen.GIF
    screen.GIF
    23.8 KB · Views: 147
Status
Not open for further replies.
Top