• 🏆 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!

Global Variable

Status
Not open for further replies.
Level 2
Joined
Nov 2, 2005
Messages
21
How do you make a global variable "LocLoc"? I need to make one to fix a bug with a spell.

Ill give an example.
Fix:
Create new global variable "LocLoc"
Then change the trigger "Blast Start" to this:
Code:
Blast Start
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Blast
Actions
Custom script: local location udg_locloc
Sound - Play MarkOfChaos <gen> at 100.00% volume, located at (Target point of ability being cast) with Z offset 0.00
Sound - Play MarkOfChaos <gen> at 100.00% volume, located at (Position of (Triggering unit)) with Z offset 0.00
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Target unit of ability being cast) Not equal to No unit
Then - Actions
Set locloc = (Position of (Target unit of ability being cast))
Unit - Create 1 Blast for (Triggering player) at ((Position of (Triggering unit)) offset by 75.00 towards (Facing of (Triggering unit)) degrees) facing locloc
Custom script: call RemoveLocation(udg_locloc)
Custom script: set udg_LocLoc = null
Else - Actions
Unit - Create 1 Blast for (Triggering player) at ((Position of (Triggering unit)) offset by 75.00 towards (Facing of (Triggering unit)) degrees) facing (Target point of ability being cast)

How do I make a global variable???
 
Level 11
Joined
Jul 20, 2004
Messages
2,760
Umm, I see your problem. You simply don't know what global variables are in world editor. Global variables are not declared like locals in the code. You "declare" them separtely. There is into the trigger editor's menu a button with a yellow X on it. Click on that one and add the global. Then all you have to do is change those custom scripts with GUI actions.

However, there are some scripts which have no correspondant such as
JASS:
call RemoveLocation(udg_locloc)

Blizzard didn't implement these in GUI. Conclusion? You'll have to deal without them if you want pure GUI.

~Daelin
 
Status
Not open for further replies.
Top