Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Special Spell triggering
Special Spell triggering
Mar 19 2014, 10:58 am
By: Stranger  

Mar 19 2014, 10:58 am Stranger Post #1



Ok, I'm working on Spells for my current map project. Most of them aren't this hard to make and will eaither strike you with thunder, or send multiple projectiles, cause an explosion, different kinds of teleports etc... Some classic and less classic stuff in order to make spells.

The spell I'm working on currently however is a bit different. I don't know if I will be able to make it work exactly the way I want, but here it is.

Imagine 2 players fighting each other, let's say P1 and P2.

P1 has the special spell I'd like to make. When he uses the spell, it will just activate. While activated, the spell should record what spells P2 casts (the recording part is fairly easy, no problem). Every next recorded spell will erase the previous recorded one. In other words, it will be able to only record 1 enemy spell at a time.

If P1 uses his special spell again, it will lock on the last spell it recorded (if by any chance there is no spell recorded, nothing happens).

If an enemy spell is "locked", then for a limited amount of time, no matter which spell P2 will attempt to cast, he should only cast the spell that has been "locked" by P1's special spell.

Here's an example :

P2 has 3 spells (Spell 1, Spell 2, Spell 3).

He uses spell 3 on P1 and it succeeds.
P1 then activates his special recording Spell.
P2 uses his Spell 1 on P1.
P1 uses his special spell again and "locks" on that Spell 1 of P2"s.
P2 wants to cast Spell 3 again, but with a "lock" being active on his Spell 1, Spell 1 is triggered and cast instead of Spell 3 (even if P2 does everything right in order to use Spell 3).
P2 tries to cast Spell 2, but it triggers his Spell 1 again (instead of Spell 2).
The effects of the recording spell wear off.
P2 tries to cast Spell 2 again, and this time it succeeds the usual way, because the "lock" has been removed.


How would you make something like this (if possible, without reproducing one spell's trigger multiple times) ?

I thought about this many times and tried to write the triggers on paper but I still can't see clearly into it.

Also, in my example P2 has a total of 3 spells but you should consider there are 15.



None.

Mar 19 2014, 12:45 pm Devourer Post #2

Hello

In my solution, the players would have a gateway to cast 4 different spells.
Yours probably differ, but the core system remains.

What we need:
- Some triggers, most obviously
- One deathcounter, used as a timer and to determine if P2 is forced to cast the same spell. This counter is called 'Timer'
- One switch, to determine if the recording has started. Lets call this one: "isRecording".
- One switch, to determine if the spell is running. Letscall this one: "isRunning".
- 3 Locations for the system itself.
- - - one is located over P2's gateway
- - - one is located on a 2x2 square somewhere else, size: 2x2 :: Called 'TriggerLoc'
- - - one is located on a 2x2 square somewhere else, size: 2x2 :: Called 'SavedLoc' :: It is a 2x2 island which is blocked by photon canon or other 2x2 building

Further I assume that this P1-Recording-Spell is triggered via training a Dragoon. P1's gateway is located in the location 'P1 Gateway'.

The Triggers:
// To start the recording:
Condition: Player 1 brings at least 1 Dragoon to 'P1 Gateway'
Condition: Switch 'isRecording' is Not Set
Action: Remove all Dragoon for Player 1 at 'P1 Gateway'
Action: Set Switch: Set 'isRecording'
Action: Remove Photon Canon from all Players at SavedLoc

// To finish the recording
Condition: Player 1 brings at least 1 Dragoon to 'P1 Gateway'
Condition: Switch 'isRecording' is Set
Action: Remove all Dragoon for Player 1 at 'P1 Gateway'
Action: Set Switch: Unset 'isRecording'
Action: Set Switch: Set 'isRunning'
Action: Set Deaths of 'Timer' to '600' for Player 1 (the value 600 is just a random number. You can adjust this)

// Player 2's spells should trigger like this usually:
Condition: Player 2 brings at least 1 X to 'P2 Gateway'
Condition: Deaths of 'Timer' for Player 1 equals 0
Action: Remove all [men] from P2 at TriggerLoc
Action: Teleport [men] from P2 Gateway to TriggerLoc

// The spells for P2 are performed when a unit is in that TriggerLoc, thus
Condition: Player 2 brings at least 1 Zealot to 'TriggerLoc'
Action: Remove all [men] for All Players at SavedLoc
Action: Teleport all [men] from TriggerLoc to SavedLoc
Action: Remove all [men] for All Players at TriggerLoc
Action: [Spell 1...]

Condition: Player 2 brings at least 1 Dragoon to 'TriggerLoc'
Action: Remove all [men] for All Players at SavedLoc
Action: Teleport all [men] from TriggerLoc to SavedLoc
Action: Remove all [men] for All Players at TriggerLoc
Action: [Spell 2...]
(and so on for all spells)


// Now, the actual trick. You need 1 trigger for each spell sadly, and this fast, I can't think of a simpler solution. But you do not have to copy any effect.
Condition: Player 2 brings at least 1 [men] to 'P2 Gateway'
Condition: Deaths of 'Timer' for Player 1 is at least 1
Condition: Player 2 brings at least 1 Zealot to SavedLoc
Condiiton: isRecording is not set
Action: Remove all [men] for Player 2 at P2 Gateway
Action: Create 1 Zealot at TriggerLoc for Player 2

Condition: Player 2 brings at least 1 [men] to 'P2 Gateway'
Condition: Deaths of 'Timer' for Player 1 is at least 1
Condition: Player 2 brings at least 1 Dragoon to SavedLoc
Condiiton: isRecording is not set
Action: Remove all [men] for Player 2 at P2 Gateway
Action: Create 1 Dragoon at TriggerLoc for Player 2

(and so on for all spells)

// When the spell expired...
Condition: Deaths of 'Timer' for Player 1 is exactly 0
Condition: Switch isRunning is Set
Action: Unset switch isRunning
Action: Remove all [men] at SavedLoc
Action: Create 1 Photon Canon at SavedLoc


I've done this concept in a hurry, so maybe there is a mistake. But it looks correct on the first glaze.

This is what it basically does:
- Spells for Player2 are only executed when the according unit is in "TriggerLoc".
- Every Spell tries to teleport the triggering unit (Zealot, Dragoon...) to "SavedLoc", which is - while the Spell is not running - blocked by a building, and then kills the unit if it failed to teleport
- While not recording, but the spell is running, the SavedLoc is not blocked. It contains 1 and always that 1 unit-type (Zealot, Dragoon...)
- In this state, P2 building a unit only indicates when to fire a spell, but it will always look what unit is held in the SavedLoc and use that Unit/Spell and ignore the one P2 has just built.
- - It copies that unit and creates it at the TriggerLoc, which will trigger the Spell. It actually replaces the Unit in "SavedLoc" with the newly created one in "TriggerLoc", but that doesn't matter since it is the same type
- When the spell expires, you create the former situation again by replacing the saved unit with the photon canon.

Maybe this works.
And now I am hoping you were using a "Train Unit to Cast" system.


EDIT: I forgot the trigger to decrease the timer
Condition: Always
Action: Subtract 1 death of Timer for Player 1

All Triggers are preserved.

Post has been edited 1 time(s), last time on Mar 19 2014, 1:07 pm by Devourer.



Please report errors in the Staredit.Network forum.

Mar 19 2014, 2:57 pm Stranger Post #3



Impressive !

Thank you VERY much for spending some time on my actual problem. Also, you've come up with a great idea and even described the triggers you would put into it.

Ok, although it might seem a pretty complex thing for just 1 spell (especially when other spells will only need 1 trigger), this is a pretty good solution and I will definitly give it a try this week.

Now the painful part is I actually started this map on November 2013 using a "Move to Beacon" spell system for some reasons, without really thinking of all the details that could be impacted in the future. Like for this recording spell.

This is the map in progress we are talking about : http://www.staredit.net/topic/16296/

You can find existing spells' descriptions in there.

A guy asked me recently if he could modify the map once it's finished in order to replace beacons by Gateways and I answered him he could ^^'

Ok then, I will try what you suggested for now :)



None.

Mar 31 2014, 9:34 am Stranger Post #4



It works ! :)

I adapted your trigger mechanics to my spell system and managed to get it work just fine :D Took me less than an hour to give it a try on applying it on one character affected by this and on one of his spells. Now I just need to do the same for other characters and all their spells :)

And hey, it's working with beacons actually :lol:

I used a trick to save me having too much trouble throughout this.

Thanks Devourer ! This is really great !



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[07:46 am]
RIVE -- :wob:
[2024-4-22. : 6:48 pm]
Ultraviolet -- :wob:
[2024-4-21. : 1:32 pm]
Oh_Man -- I will
[2024-4-20. : 11:29 pm]
Zoan -- Oh_Man
Oh_Man shouted: yeah i'm tryin to go through all the greatest hits and get the runs up on youtube so my senile ass can appreciate them more readily
You should do my Delirus map too; it's a little cocky to say but I still think it's actually just a good game lol
[2024-4-20. : 8:20 pm]
Ultraviolet -- Goons were functioning like stalkers, I think a valk was made into a banshee, all sorts of cool shit
[2024-4-20. : 8:20 pm]
Ultraviolet -- Oh wait, no I saw something else. It was more melee style, and guys were doing warpgate shit and morphing lings into banelings (Infested terran graphics)
[2024-4-20. : 8:18 pm]
Ultraviolet -- Oh_Man
Oh_Man shouted: lol SC2 in SC1: https://youtu.be/pChWu_eRQZI
oh ya I saw that when Armo posted it on Discord, pretty crazy
[2024-4-20. : 8:09 pm]
Vrael -- thats less than half of what I thought I'd need, better figure out how to open SCMDraft on windows 11
[2024-4-20. : 8:09 pm]
Vrael -- woo baby talk about a time crunch
[2024-4-20. : 8:08 pm]
Vrael -- Oh_Man
Oh_Man shouted: yeah i'm tryin to go through all the greatest hits and get the runs up on youtube so my senile ass can appreciate them more readily
so that gives me approximately 27 more years to finish tenebrous before you get to it?
Please log in to shout.


Members Online: lil-Inferno, C(a)HeK, Dem0n, No-Name-Needed-II