(2 ratings)
Hmm, spell too simple, store everything that will used twice to a variable ( GetTriggerUnit() and GetSpellTargetUnit() )
Spell is very very simple but it is useful ^^. 3/5.
Store GetTriggerUnit and GetSpellTargetUnit in the variable. Configuration gone . Read spell submission rules http://www.hiveworkshop.com/forums/beta-rules-information-710/spell-submission-rules-230362/
referencing to a local variable is faster than function call, even native function.From what I recall, using a local is slower than calling the native 3 times (or somewhere around there). Could be wrong though, haven't touched WE for about an year.
well keep it simple
I type it manually, so..
- Ruse Switch
- Events
- Unit - A unit Starts the effect of an ability
- Conditions
- (Ability being cast) Equal to Ruse Switch
- Actions
- -------- this doesn't need configurable variables :P --------
- set TempPoint[1] = Position of (Triggering Unit)
- set TempPoint[2] = Position of (Event Response - Target of Ability being Cast)
- Unit - Move (Triggering Unit) to TempPoint[2]
- Unit - Move (Event Response - Target of Ability being Cast) to TempPoint[1]
- custom script: RemoveLocation(udg_TempPoint[1])
- custom script: RemoveLocation(udg_TempPoint[2])
- ------- that is more simple units swaping triggers -------
yeah, I can't beat magh and kobas :/honestly, chronos_077's trigger is better because it avoid the use of location
REVIEW|Ruse Switch|v1.1
|
Resource Status: Needs Fix Rating: 3/5 (Useful) |
GENERAL
|
|
PROS
|
|
CONS
|
|
SUGGESTIONS
|
|
how do i change locals to globals?
Basically, the idea is that since you declared RS_caster and RS_target, might as well use those variables to save a few native calls.
You could also use global variables for your x's and y's. That way, you can eliminate the use of locals altogether. But using locals for your x's and y's are fine.
- Custom script: local real x1
- Custom script: local real x2
- Custom script: local real y1
- Custom script: local real y2
- set RS_caster = (Triggering unit)
- set RS_target = (Target unit of ability being cast)
- Custom script: set x1 = GetUnitX ( udg_RS_caster )
- Custom script: set y1 = GetUnitY ( udg_RS_caster )
- Custom script: set x2 = GetUnitX ( udg_RS_target )
- Custom script: set y2 = GetUnitY ( udg_RS_target )
- Custom script: call SetUnitX ( udg_RS_caster, x2 )
- Custom script: call SetUnitY ( udg_RS_caster, y2 )
- Custom script: call SetUnitX ( udg_RS_target, x1 )
- Custom script: call SetUnitY ( udg_RS_target, y1 )
? The user that will download this spell and import it to another map will gives errors about X/Y and if he do that, it is like he made a spell to turn in JASS.
Make it like this:
- Set RS_caster = (Triggering unit)
- set RS_target = (Target unit of ability being cast)
- Custom script: set udg_x1 = GetUnitX ( udg_RS_caster )
- Custom script: set udg_x2 = GetUnitX ( udg_RS_target )
- Custom script: set udg_y1 = GetUnitY ( udg_RS_caster )
- Custom script: set udg_y2 = GetUnitY ( udg_RS_target )
- Custom script: call SetUnitX ( udg_RS_caster , udg_x2 )
- Custom script: call SetUnitY ( udg_RS_caster , udg_y2 )
- Custom script: call SetUnitX ( udg_RS_target , udg_x1 )
- Custom script: call SetUnitY ( udg_RS_target , udg_y1 )
how can a local variable instance give error when copied into another map? the only bad thing about using custom script in GUI is just it limits further modification by pure GUI users.? The user that will download this spell and import it to another map will gives errors about X/Y and if he do that, it is like he made a spell to turn in JASS.
Make it like this:
- Set RS_caster = (Triggering unit)
- set RS_target = (Target unit of ability being cast)
- Custom script: set udg_x1 = GetUnitX ( udg_RS_caster )
- Custom script: set udg_x2 = GetUnitX ( udg_RS_target )
- Custom script: set udg_y1 = GetUnitY ( udg_RS_caster )
- Custom script: set udg_y2 = GetUnitY ( udg_RS_target )
- Custom script: call SetUnitX ( udg_RS_caster , udg_x2 )
- Custom script: call SetUnitY ( udg_RS_caster , udg_y2 )
- Custom script: call SetUnitX ( udg_RS_target , udg_x1 )
- Custom script: call SetUnitY ( udg_RS_target , udg_y1 )
too much watching Adventure Time. i seeWhat are you going on about finn?! I mean jake?! The coordinate variables are locals so it does not need to be instantiated (created) by World Editor. Stop hating on jass.
yeah, how could locals cause an error?? The user that will download this spell and import it to another map will gives errors about X/Y and if he do that, it is like he made a spell to turn in JASS.
Make it like this:
- Set RS_caster = (Triggering unit)
- set RS_target = (Target unit of ability being cast)
- Custom script: set udg_x1 = GetUnitX ( udg_RS_caster )
- Custom script: set udg_x2 = GetUnitX ( udg_RS_target )
- Custom script: set udg_y1 = GetUnitY ( udg_RS_caster )
- Custom script: set udg_y2 = GetUnitY ( udg_RS_target )
- Custom script: call SetUnitX ( udg_RS_caster , udg_x2 )
- Custom script: call SetUnitY ( udg_RS_caster , udg_y2 )
- Custom script: call SetUnitX ( udg_RS_target , udg_x1 )
- Custom script: call SetUnitY ( udg_RS_target , udg_y1 )
i guess it'll be his decision@chobibo
Anyway I'm not hating JASS. I mean that if he start doing declare variables in locals, it might be he turn the spell ( GUI ) into JASS, so it is better to turn it in JASS than GUI.
@chobibo
Anyway I'm not hating JASS. I mean that if he start doing declare variables in locals, it might be he turn the spell ( GUI ) into JASS, so it is better to turn it in JASS than GUI.
SetUnitX
and SetUnitY
isn't "GUI" either.
|