Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: [SOLVED] Simple problem
[SOLVED] Simple problem
Jul 10 2011, 9:09 pm
By: Son-  

Jul 10 2011, 9:09 pm Son- Post #1



im trying to make the spell system where the player creates a unit at a location useing gas as AP and the unit cost at the building as the cost of the spell and so forth i have all the spells working and everything but im trying to make it to where it dosent double cast...heres the triggers i have now

Trigger("Player 1"){
Conditions:
Bring("Player 1", "Alexei Stukov (Ghost)", "Hero1", At least, 1);
Bring("Player 1", "Protoss Shuttle", "Hero Spells", At least, 1);
Deaths("Player 1", "Uraj Crystal", At least, 1);
Deaths("Player 1", "Zerg Ultralisk Cavern", Exactly, 0);

Actions:
Remove Unit At Location("Player 1", "Protoss Shuttle", All, "Hero Spells");
Set Deaths("Player 1", "Zerg Ultralisk Cavern", Set To, 120);
Create Unit with Properties("Player 1", "Terran Medic", 1, "Hero", 1);
Display Text Message(Always Display, "\x004Heal Used\x004 \x008-25AP\x008");
Preserve Trigger();
}


Trigger("Player 1"){
Conditions:
Deaths("Player 1", "Zerg Ultralisk Cavern", Exactly, 0);
Bring("Player 1", "Alexei Stukov (Ghost)", "Anywhere", At least, 1);

Actions:
Remove Unit At Location("Player 1", "Terran Medic", All, "Anywhere");
Preserve Trigger();
Comment(" Spell1");
}

//-----------------------------------------------------------------//

Trigger("Player 1"){
Conditions:
Bring("Player 1", "Protoss Shuttle", "Hero Spells", At least, 1);
Deaths("Player 1", "Zerg Ultralisk Cavern", At least, 1);
Actions:
Remove Unit At Location("Player 1", "Protoss Shuttle", All, "Hero Spells");
Set Resources("Player 1", Add, 25, gas);
Display Text Message(Always Display, "You cannot use that ability at this time.");
Preserve Trigger();

and ive tryed it many other different ways if someone could tell me where the problem is i would appreciate it

Post has been edited 1 time(s), last time on Jul 10 2011, 9:22 pm by Son-.



None.

Jul 10 2011, 9:20 pm Killer2121 Post #2



do you have hyper triggers? if so try adding a 50 millisecond wait between the spawning process.

you may find it easier to make the spells from a building (Gateway...)



None.

Jul 10 2011, 9:24 pm Son- Post #3



yea i have hyper triggers and im makeing the spells from a Robotics Facility



None.

Jul 10 2011, 9:29 pm Roy Post #4

An artist's depiction of an Extended Unit Death

I assume you also have a trigger constantly subtracting the Ultralisk death counter?

I don't see how your system double-casts. It's impossible for the first trigger to fire twice in a row because of the death condition. Is it creating two medics from one shuttle? Or is it allowing you to cast it again when the spell shouldn't be ready?

Quote from Killer2121
do you have hyper triggers? if so try adding a 50 millisecond wait between the spawning process.
I would avoid using waits, especially in this instance.




Jul 10 2011, 9:38 pm Son- Post #5



Quote from Roy
I assume you also have a trigger constantly subtracting the Ultralisk death counter?
yes i do


its acually not double casting wat it is doing is when ever i use the spell it will add 25gas and display the You cannot cast text every time u make a shuttle... the medic will only appear once, run out its death counts, disapear and then u can cast agian. If i dont have that trigger and u have a medic out and try to cast agian the shuttle will just be there.

i guess its really not called double casting more like unable to cast becuz spell is already active



None.

Jul 10 2011, 9:52 pm Roy Post #6

An artist's depiction of an Extended Unit Death

It sounds like your first listed trigger is not properly removing the Shuttle, then. Maybe you have accidentally duplicated a similar trigger? The trigger posted is correct, but it won't fire if another trigger like it runs before it does.

For clarification, it displays "Heal Used" followed by "You cannot use that ability at this time."? If it isn't displaying the "Heal Used," it's definitely a duplicate, incomplete trigger firing.

You may want to post the map for further evaluation.




Jul 10 2011, 9:59 pm Son- Post #7



Quote
For clarification, it displays "Heal Used" followed by "You cannot use that ability at this time."? If it isn't displaying the "Heal Used," it's definitely a duplicate, incomplete trigger firing.
yea the first time when the medic acually spawns it says both the rest of the time it just says "You cannot use that ability at this time."


double, triple checked cant find any incomplete triggers...there pretty organized i think
i couldnt figure it out i thought it was i problem with the bring/command/kill/remove but i looked it up and even tryed it all the different ways :\ idk

Attachments:
Lances Project.scx
Hits: 2 Size: 100.72kb

Post has been edited 2 time(s), last time on Jul 10 2011, 11:09 pm by Son-.



None.

Jul 10 2011, 10:54 pm Vrael Post #8



For any problem like this, you have to trace back through your trigger conditions, because a trigger can't fire unless all its conditions are met. That means, during the trigger cycle immediately following the construction of the shuttle, all these conditions are true:

Bring("Player 1", "Alexei Stukov (Ghost)", "Hero1", At least, 1);
Bring("Player 1", "Protoss Shuttle", "Hero Spells", At least, 1);
Deaths("Player 1", "Uraj Crystal", At least, 1);
Deaths("Player 1", "Zerg Ultralisk Cavern", Exactly, 0);

So the trigger fires. Now, that trigger firing modifies deaths of zerg ultralisk cavern and removes the shuttle, invalidating two of these conditions. So by the time it gets to the trigger with these conditions:

Bring("Player 1", "Protoss Shuttle", "Hero Spells", At least, 1);
Deaths("Player 1", "Zerg Ultralisk Cavern", At least, 1);

The first one should be false, and the second one should be true, so that trigger doesn't run. But you're saying it IS running, which means both those conditions are true. We know the zerg ultralisk deaths are true, so it seems that the shuttle condition is the problem. A few things could be happening. You might have another trigger that is moving/creating a shuttle to location Hero Spells accidentally. Trigger cycles are only 84ms apart, so maybe the shuttle doesn't appear until next trigger cycle, but you can't tell the difference because they happen so fast. You DO have the "Remove unit at location" action in there, so it can't be the bring data update problem that starcraft sometimes suffers from, but keep this bug in mind just in case. Try copying your text triggers into a word file and search through all the instances of Protoss Shuttle or Hero Spells to see if there's an accidental shuttle being thrown in there somewhere.

Also, place a medic or dark templar or something somewhere on the map so it will save as a .scx instead of a .scm. Just in case. Starcraft (not broodwar) has a lot of limits that Brood War does not.



None.

Jul 10 2011, 11:19 pm Son- Post #9



i could see it being a shuttle problem if it was just that one spell but its doing the same thing when i try to cast spell 2(reaver 50gas) or 3(observer 75gas) which are on different death counters...and there are no other triggers that even mess with the Hero Spells location or units spell 1 2 and 3 or the 3 three death counter units im completely stumped and ive went threw my triggers multiple times :\



None.

Jul 10 2011, 11:59 pm Vrael Post #10



Well, focus on this one case first. Clearly that shuttle is still in the location. Try this first:

After you save it as a .scx. Add another trigger like this right before the one that says "You cannot use that ability at this time."

Trigger("Player 1"){
Conditions:
Bring("Player 1", "Protoss Shuttle", "Hero Spells", At least, 1);
Deaths("Player 1", "Zerg Ultralisk Cavern", Exactly, 120);
Actions:
Display Text Message(Always Display, "Shuttle is here still!.");
Preserve Trigger();


If this trigger fires, it means that the cast was detected by the trigger which sets the deaths to 120, and the bug is happening during the same trigger cycle as that cast since the deaths are exactly 120. If you see the text "shuttle is here still!" it means either your trigger is accidentally removing the wrong unit (maybe you renamed another unit "Protoss Shuttle") or you're encountering a Bring data block update glitch. Come back with the results for us.

I'm not sure if any of this applies if its a non-BroodWar map though.



None.

Jul 11 2011, 12:16 am Son- Post #11



i did it and the message is poping up....dosent make any sence...no units named the same becuz i could see the unit name repeat...if i completly delete this Unable to cast trigger and the player dosent try to use a spell while one is active it works perfectly the shuttly removes and everything...theres no other triggers interfering could u maybe take a look maybe im jus freakin blind but ive looked so many times lol ive been tryin to figure it out for a week befor i even brought it to sen...and ive made this same system befor urgh

and yes it definatly the shuttle...ive tried to regognize this spell is active by useing Bring atleast 1 medic to anywhere, and i tryed to use switches...



None.

Jul 11 2011, 12:42 am Ahli Post #12

I do stuff and thingies... Try widening and reducing the number of small nooks and crannies to correct the problem.

The shuttle is still there in the conditions. That data hasn't been updated after removing. Centering a location to a location (anywhere on anywhere) after removing the unit might fix this.

Other fix:
Check for the upper boundary which would be "at most 119 deaths of ultralisk cavern". (So, if you lower the DC every trigger cycle, it won't run in the one that casts the spell.) Then you won't have the message after each cast...




Jul 11 2011, 1:23 am Roy Post #13

An artist's depiction of an Extended Unit Death

Well, this is unrelated to the issue, but there's an error in your AragornSpell2. Your condition has a Sunken Colony death counter and your action is setting the Ultralisk Cavern death counter.

This is more of a hotfix than a solution, but you can move the "You cannot cast" trigger above the "Heal Used" trigger and it will work as you intended.

The issue at hand seems to be that while the "Heal Used" trigger is both running first and has a functional "Remove Unit" action, the Shuttle is still detectable through triggers until the end of the trigger cycle. This is not normally the case, and I haven't been able to debug it beyond that point.
Quote from Ahli
The shuttle is still there in the conditions. That data hasn't been updated after removing.
Oh, maybe that's it.




Jul 11 2011, 1:51 am Son- Post #14



Quote from Ahli
Other fix:
Check for the upper boundary which would be "at most 119 deaths of ultralisk cavern". (So, if you lower the DC every trigger cycle, it won't run in the one that casts the spell.) Then you won't have the message after each cast...
that acually works :O lol thanks man i knew it would be something simple like that cant belive i didnt try that :\


and yea roy i stopped makeing aragorn spells becuz i wanated to fix this befor i moved on with it but i fixed that



None.

Jul 11 2011, 2:39 am Vrael Post #15



Just so you know whats behind it, Starcraft doesn't update "Bring" data before every trigger, only at the beginning of the trigger cycle. Some triggers can invalidate that bring data, so when other triggers get to it they end up using the wrong stuff. That's what's happening here I believe, though I didn't think that would be it since "Remove unit at location" is supposed to update the Bring Data for that location. Hrm...

Also, some helpful reading for you: http://www.staredit.net/starcraft/Triggers
There's also a section on the bug happening in your triggers in that article.



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[03:55 pm]
Zoan -- :wob:
[10:34 am]
NudeRaider -- SEN doesn't rely on spammers initiate its sleep cycle. It hat fully automated rest and clean-up phases. Please understand that this is necessary for the smooth operation of the site. Thank you.
[03:45 am]
Sylph-Of-Space -- Does the shoutbox get disabled when there's spammers?
[2024-5-17. : 6:47 am]
NudeRaider -- lil-Inferno
lil-Inferno shouted: nah
strong
[2024-5-17. : 5:41 am]
Ultraviolet -- 🤔 so inf is in you?
[2024-5-17. : 4:57 am]
O)FaRTy1billion[MM] -- my name is mud
[2024-5-17. : 4:35 am]
Ultraviolet -- mud, meet my friend, the stick
[2024-5-16. : 10:07 pm]
lil-Inferno -- nah
[2024-5-16. : 8:36 pm]
Ultraviolet -- Inf, we've got a job for you. ASUS has been very naughty and we need our lil guy to go do their mom's to teach them if they fuck around, they gon' find out
[2024-5-16. : 5:25 pm]
NudeRaider -- there he is, right on time! Go UV! :D
Please log in to shout.


Members Online: 9sophiec5285ep5, 8charlottee882wh3, newageofpower