Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Triggers are my downfall!
Triggers are my downfall!
Feb 21 2008, 8:21 pm
By: mautty  

Feb 21 2008, 8:21 pm mautty Post #1



Ok, well...I'm making a (don't sigh...) Resident Evil map of my own creation set out in the desert. 6 survivors wind up stuck in an old, run down desert installation and the undead swarm even those sandy dunes of the desert around them.

Well, I wanna make this fun, but challenging and realistic to a zombie killing fun fest! So...I wanna use an ammo element in the game but not sure exactly how to.

I have two ideas...first to use minerals or gas as the 'ammo counter' and when it depletes just have the person stop shooting. (I don't know if that could even actually work!) My second was that I currently have 2 small building, one is an smg storage, the other a rifle storage, and after depleting said ammo, the unit reverts back to an unarmed civilian and must go back to the storage for ammo.

I could implement the second idea fairly well...but I'm still trying to learn my way around the spawn triggers like I would need for this, being that they will spawn exactly where the previous unit was taken no matter what location they're at. Like if my smg carrier is at the edge of the installation shooting and runs out of ammo, he won't revert back to a civie and appear right next to the gun storage every time.

Also, I was wondering how to preserve the hp when switching between units. I have no clue how to do that, and the maps which I've seen it done on that I have are all security locked with StarForge...so I can't look at the triggers to see how it was done.

Thanks in advance for any help!

Edit: I'm gonna just add this in and get it out of the way first. To make computer units spawn (by trigger) and then move in specific direction like they do in Raccoon City and Turret D maps, is that an AI script or trigger controlled?

Post has been edited 1 time(s), last time on Feb 21 2008, 8:30 pm by mautty.



None.

Feb 21 2008, 8:37 pm NudeRaider Post #2

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

I personally don't like the idea with the storage buildings, but if you decide on it I'm willing to help you with that too.

The ammo system depending on resources isn't very difficult to implement and quite convenient to play.
Let ore be your clip count and gas be your ammo count of the current clip.
Initialize it to any desired value.

Then make trigger that detects a kill (current player has at least 1 kills score) and subtract 1 gas per kill and resets the kills score to 0.

When gas reaches zero set a death counter to say 16 (=2s reload).
During the reloading process constantly (with hyper triggers) ally the player to all other players (this will prevent him from shooting. YAY! ;)) and subtract 1 of the death counter every loop.
When the death counter has reaches 1 count, set it to 0, subtract 1 ore and add x gas, where x is the clip size of the current weapon and reset alliance statuses.

You cannot transfer the current hp of the old unit to the new one. But you can move the old unit to a temporary location instead of removing it, to preserve the hp for THIS unit when the player changes back to it.




Feb 21 2008, 8:57 pm mautty Post #3



This is perfect, I can put together a good trigger keeping this is mind now. The links were also of great help, and I didn't know you could use other units as death counters...I'll keep that in mind for later as well.

Though, I may have a bit of a problem with this part;
Quote from NudeRaider
Then make trigger that detects a kill (current player has at least 1 kills score) and subtract 1 gas per kill and resets the kills score to 0.
as the unit won't be making a kill every time it shoots something. Is there a way to set a trigger which will subtract 1 from the ammo ( mineral/gas) count by just firing?

As for the unit hp, is there a way to set something up similar to:
Move unit 1 from location X to location Y.
Move unit 2 from location Y to location X.
Set current HP of unit 2 equal to unit 1.
I know I've played maps where units will start off with less than their max amount of hp before. I'm still sifting through triggers while browsing these forums though, so hopefully I can either figure it out myself, find another thread answering my questions, or get another reply here that helps just as much.



None.

Feb 21 2008, 11:33 pm Falkoner Post #4



In maps where they start off with less health, they simply have a death count keeping track of what health the player currently has upgraded to, and they set your health to a different amounts when you heal based on what level you are on.

No, there's really no way to detect when a unit fires, you just have to assume that they fired a certain amount of times to kill the unit.



None.

Feb 22 2008, 12:17 am mautty Post #5



I've skipped the entire ammo thing and continued creating the map...so far I have most of the basic triggers done and planned for exceptions, errors, small things that players may do instead of what the triggers were intended for (though I have no doubt someone will think of something I didn't...), and it's coming along quite well. The more I continue to search through each trigger and test them in a closed online match...the more ways I think of to do something and ways to set each trigger.

As for certain objective based triggers, I'm using the 'objects' ore and gas count to trigger them. Objects is whichever npc units and building that are neither enemy nor player controlled, such as the weapons storages, the radio tower, and the dropship and reinforcements.

I'll keep working on it for now and maybe share it when done if I believe it's decent enough!



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[11:45 pm]
ClansAreForGays -- Anyone wanna played Skewed StarCraft?
[2026-4-14. : 12:07 am]
Vrael -- NudeRaider
NudeRaider shouted: Vrael ranting still is though
you're a gentleman and a scholar, thank you
[2026-4-13. : 10:07 pm]
NudeRaider -- ya why phone people when you can just write letters
[2026-4-13. : 9:37 pm]
IskatuMesk -- I have never and will never own a phone
[2026-4-13. : 9:15 pm]
NudeRaider -- Vrael ranting still is though
[2026-4-13. : 9:14 pm]
ClansAreForGays -- anticapitalism isnt edgy anymore
[2026-4-13. : 3:31 pm]
Vrael -- it only costs 50% of my post-tax salary for life and in return I get to also become a drone whose sole purpose is CAPITALISM
[2026-4-13. : 3:30 pm]
Vrael -- pssht, you're still using a phone? I just record 100% of my life using my ElonBrainChip
[2026-4-13. : 2:13 pm]
NudeRaider -- bro I don't go anywhere without my phone to record anything significant
[2026-4-13. : 1:28 pm]
Vrael -- Zoan
Zoan shouted: not if u wer there
id say even if you were there its tricky, human memory can be very faulty
Please log in to shout.


Members Online: Moose