MoonSlinger
I Love using Cheap Tricks... only Results matters
- Reaction score
- 74
--- Introduction ---
I have derived a method that can make ANY spell Multi-Instance.
Multi-Instance means an ability can be cast many times without the codes interfering with each other.
It is not restricted to "per Player" or even "per Unit".
This is created for GUI, but if you take it as a Concept rather then a System. It can be applied to many things.
--- How to do it ---
I call it a 2-Step Trigger:
When the "Casting" trigger fires, it will store information needed in preset arrays and unleash the "Spell" triggers to complete the task. Heres the templates for the triggers:
There will be multiple "Spell" Triggers stored in an array for the "Casting" trigger to call (reflected by the red code above).
Basically all the spell triggers are the same, except the variables; They need to be hard-coded.
--- Explanation ---
Overall, this is more a Concept then a System
To use an analogy:
- Assuming you own a Hotel, with guest coming a random times, sometimes alone, sometimes in a crowd.
- When a guest, A comes, you sent him/her to one of your rooms, you set the room to be "occupied"
- When another guest, B comes along, you allocate another room for him/her
- When the guest, A leaves, you clean up the room and it becomes usable for future guest.
- As long as you have more rooms then possible guest coming, you can accommodate everyone
Similarly for triggers: I created a "Casting" trigger
- When the Ability is cast, allocate "space" for it.
- When the Ability is cast again before the first one ends, allocate another "space" for it.
- When the Ability ends, clean up.
- Just make sure you have more "spaces" preset to prevent overflowing.
So, Basically, you create many "Spaces" for the Ability. Each time the Ability is used, one of the spaces will be allocated. "Spaces" you need is highly dependent on the situation.
- An AOS type map where each user only controls a "Hero", number of "Spaces" needed would equate number of player.
- An upgrade of a basic unit's ability would require much more "Spaces" as the ability would be very frequently used.
--- In Action ---
I have attached a map with the Templates and a working version
Basically, you have a "Banshee" with an edited version of "Curse" :nuts:
What Spell Do:
- Change ownership of cursed unit to the caster
- After 10seconds, Unit experience emotional struggle (Pause)
- After 5 seconds of emotional turmoil, the Unit cannot tolerate being controlled and self destruct dealing damage to nearby enemy units
The spell is simple as I want the focus to be on the System.
And take note of the time when the spell fizzles :shades:
--- Conclusion ---
Feedback welcome
Will try to terrain the map and release wit v.1.1 with updates
I have derived a method that can make ANY spell Multi-Instance.
Multi-Instance means an ability can be cast many times without the codes interfering with each other.
It is not restricted to "per Player" or even "per Unit".
This is created for GUI, but if you take it as a Concept rather then a System. It can be applied to many things.
--- How to do it ---
I call it a 2-Step Trigger:
When the "Casting" trigger fires, it will store information needed in preset arrays and unleash the "Spell" triggers to complete the task. Heres the templates for the triggers:
Code:
Template Casting
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to YourAbility
Actions
For each (Integer B) from 1 to 10, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Active[(Integer B)] Equal to False
Then - Actions
-------- Initialization --------
Set Active[(Integer B)] = True
-------- Delete Where Applicable or DWA --------
Set DWACastingPoint[(Integer B)] = (Position of (Triggering unit))
Set DWACastingUnit[(Integer B)] = (Triggering unit)
Set DWATargetPoint[(Integer B)] = (Target point of ability being cast)
Set DWATargetUnit[(Integer B)] = (Target unit of ability being cast)
-------- Run External Trigger --------
[COLOR="Red"]Trigger - Run SpellTriggers[(Integer B)] (ignoring conditions)[/COLOR]
Skip remaining actions
Else - Actions
Do nothing
Game - Display to (All players matching ((Owner of (Triggering unit)) Equal to (Matching player))) the text: Spell Fizzle
There will be multiple "Spell" Triggers stored in an array for the "Casting" trigger to call (reflected by the red code above).
Basically all the spell triggers are the same, except the variables; They need to be hard-coded.
Code:
Template SpellTrigger01
Events
Conditions
Actions
-------- Whatever Actions you want --------
-------- Clean Up --------
Set Active[1] = False
Custom script: call RemoveLocation(udg_DWACastingPoint[1])
Custom script: call RemoveLocation(udg_DWATargetPoint[1])
--- Explanation ---
Overall, this is more a Concept then a System
To use an analogy:
- Assuming you own a Hotel, with guest coming a random times, sometimes alone, sometimes in a crowd.
- When a guest, A comes, you sent him/her to one of your rooms, you set the room to be "occupied"
- When another guest, B comes along, you allocate another room for him/her
- When the guest, A leaves, you clean up the room and it becomes usable for future guest.
- As long as you have more rooms then possible guest coming, you can accommodate everyone
Similarly for triggers: I created a "Casting" trigger
- When the Ability is cast, allocate "space" for it.
- When the Ability is cast again before the first one ends, allocate another "space" for it.
- When the Ability ends, clean up.
- Just make sure you have more "spaces" preset to prevent overflowing.
So, Basically, you create many "Spaces" for the Ability. Each time the Ability is used, one of the spaces will be allocated. "Spaces" you need is highly dependent on the situation.
- An AOS type map where each user only controls a "Hero", number of "Spaces" needed would equate number of player.
- An upgrade of a basic unit's ability would require much more "Spaces" as the ability would be very frequently used.
--- In Action ---
I have attached a map with the Templates and a working version
Basically, you have a "Banshee" with an edited version of "Curse" :nuts:
What Spell Do:
- Change ownership of cursed unit to the caster
- After 10seconds, Unit experience emotional struggle (Pause)
- After 5 seconds of emotional turmoil, the Unit cannot tolerate being controlled and self destruct dealing damage to nearby enemy units
The spell is simple as I want the focus to be on the System.
And take note of the time when the spell fizzles :shades:
--- Conclusion ---
Feedback welcome
Will try to terrain the map and release wit v.1.1 with updates