Staredit Network

Staredit Network -> UMS Assistance -> Money for Deaths . . .
Report, edit, etc...Posted by Yossarian on 2005-10-18 at 09:41:10
Hey, guys, I've got a problem. (Yeah, I know, duh.) Anyhow, I've got triggers to give a player money when he dies. They go something like this:


Trigger
Description:
You get $100 for every marine death.
Players:
¤ All Players / Force 1 / Player 1
Conditions:
¤ If CURRENT PLAYER suffers AT LEAST 1 DEATH of a MARINE.
Actions:
¤ Set DEATHS OF MARINE for CURRENT PLAYER to 0.
¤ Modify resources for current player: add 100 ore.
¤ Preserve trigger.


Before, I made similar triggers to give players money if their enemies' men died. That was basically my primitive version of money for kills, before I figured out how to use player kill scores. I have a map in which those triggers work perfectly. The trigger structure is the same in both maps, my old one and this newer one with which I'm having trouble. Both use hyper triggers, which is the only thing I can imagine affectingthe situation.

I'm totally stumped, guys, and I really need to get this to work. Any ideas?
Report, edit, etc...Posted by Subrosian on 2005-10-18 at 12:49:42
¤ Set DEATH COUNT for CURRENT PLAYER to 0.
change this to subtract 1 deathcount.

That should work for getting money properly.
Report, edit, etc...Posted by PlayaR on 2005-10-18 at 15:00:09
how about this trigger
i have no clue if this will work not lol
but i just came up with it as i finished reading the post and the reply tongue.gif
just try it and if it doesnt work sorry lol

Trigger #1

------------------------------------------------------------------------
Conditions :
------------------
Current player kills atleast 1 marine
------------------------------------
Actions :
------------------
Set Switch x
------------------
Preserve Trigger
------------------------------------------------------------------------

Trigger #2

------------------------------------------------------------------------
Conditions :
------------------
Switch x is Set
------------------------------------
Actions :
------------------
Modify resources for current player: add 100 ore.
------------------
Disable Switch x
------------------
Preserve Trigger
------------------------------------------------------------------------
Report, edit, etc...Posted by LegacyWeapon on 2005-10-18 at 15:34:17
QUOTE(Subrosian @ Oct 18 2005, 12:49 PM)
¤ Set DEATH COUNT for CURRENT PLAYER to 0.
change this to subtract 1 deathcount.

That should work for getting money properly.
[right][snapback]336279[/snapback][/right]
Yes, and make sure to subtract for Terran Marine.
QUOTE(GgG-PlayaR. @ Oct 18 2005, 03:00 PM)
how about this trigger
i have no clue if this will work not lol
but i just came up with it as i finished reading the post and the reply tongue.gif
just try it and if it doesnt work sorry lol

Trigger #1

------------------------------------------------------------------------
Conditions :
------------------
Current player kills atleast 1 marine
------------------------------------
Actions :
------------------
Set Switch x
------------------
Preserve Trigger
------------------------------------------------------------------------

Trigger #2

------------------------------------------------------------------------
Conditions :
------------------
Switch x is Set
------------------------------------
Actions :
------------------
Modify resources for current player: add 100 ore.
------------------
Disable Switch x
------------------
Preserve Trigger
------------------------------------------------------------------------
[right][snapback]336318[/snapback][/right]
I don't think the switch is necessary.

Keep in mind, Yossarian, that triggers killing/removing units does not contribute to the death counts of that unit.
Report, edit, etc...Posted by PlayaR on 2005-10-18 at 16:24:16
QUOTE(LegacyWeapon @ Oct 18 2005, 03:34 PM)
Yes, and make sure to subtract for Terran Marine.
I don't think the switch is necessary.

Keep in mind, Yossarian, that triggers killing/removing units does not contribute to the death counts of that unit.
[right][snapback]336345[/snapback][/right]


it is needed because if the whole switch part is not there
the mins will keep going up by 100 forever -.-
believe me thats what happened to my map b4 i tried the kills to cash method #1
Report, edit, etc...Posted by masterchiefxl on 2005-10-18 at 16:26:25
is that the universal death counter? make it specificly for marines. also, make it a normal trigger and see what happens.
Report, edit, etc...Posted by Urmom(U) on 2005-10-18 at 16:32:47
playar, your trigger would not work at all. you cant set kills, i thought its been said enough times before.
Report, edit, etc...Posted by Subrosian on 2005-10-18 at 16:36:47
QUOTE(GgG-PlayaR. @ Oct 18 2005, 02:24 PM)
it is needed because if the whole switch part is not there
the mins will keep going up by 100 forever -.-
believe me thats what happened to my map b4 i tried the kills to cash method #1
[right][snapback]336384[/snapback][/right]


The triggers won't work because Switch "x" will be set no matter what and Trigger #2 will keep firing.
Report, edit, etc...Posted by PlayaR on 2005-10-18 at 18:36:02
QUOTE(urmom @ Oct 18 2005, 04:32 PM)
playar, your trigger would not work at all.  you cant set kills, i thought its been said enough times before.
[right][snapback]336393[/snapback][/right]


in my trigger there are no actions which "set kills"
its really set minerals not kills look carefull lol
Report, edit, etc...Posted by PCFredZ on 2005-10-18 at 19:29:30
There's nothing wrong with his original trigger unless he suffers more than 1 death of marines at the same time.

Yossarian, can you attach your map?
Report, edit, etc...Posted by Yossarian on 2005-10-18 at 22:54:12
So, you guys are basically telling me that my trigger isn't specific enough? When I make triggers, I try to make them as general as possible. Not only does that make changing them easier, but it also makes cloning them a breeze. For example, the "current player" tag allows the same trigger to be used for any player, because it deals with the player at hand, whereas something specific like "player 1" restricts it and forces you to change it for every different player. Anyhow, enough about what I do.

So, back to the triggers. Legacy, I see what you mean, and I actually tried a similar sort of thing, but it didn't work. The money would stop being given, but at some seemingly random number in the thousands. I will attach my map. Note that this is a 3 vs 3 map with no computer players, but I'll set it up so you can play it single player before I attach it. Also, remember that I'm giving money to a player when he loses men, so just kill one of your own guys. The triggers all have comments, so it should be easy enough to find the relevant ones.

[attachmentid=14616]
Report, edit, etc...Posted by PCFredZ on 2005-10-19 at 15:32:15
The problem with your trigger is that you used "Set deaths for current player: set to 0 for men." This will not work. You must change the unit to a specific unit, using "Men", "Any Unit", etc., does not actually set the death for anything to 0.
Report, edit, etc...Posted by Urmom(U) on 2005-10-19 at 17:25:16
QUOTE(GgG-PlayaR. @ Oct 18 2005, 06:36 PM)
in my trigger there are no actions which "set kills"
its really set minerals not kills look carefull lol
[right][snapback]336561[/snapback][/right]


Well I assume that he wants to use the trigger more than once. What would be the point of preserving your trigger then?
Report, edit, etc...Posted by DT_Battlekruser on 2005-10-19 at 19:25:25
Playa's trigger will give infinite minerals because of this:

*Player kills 1 marine

TRIGGER LOOP 1 {deaths of marine = 1, switch x = clear}
TRIGGER 1 {if deaths of marine >= 1: then switch x = set}
TRIGGER 1 FIRES, {switch x = set}
TRIGGER 2 {if switch x == set: then add 100 ore AND switch x = clear}
TRIGGER 2 FIRES, {player ore += 100, switch x = clear}

TRIGGER LOOP 2 {deaths of marine = 1, switch x = clear}
TRIGGER 1 {if deaths of marine >= 1: then switch x = set}
TRIGGER 1 FIRES, {switch x = set}
TRIGGER 2 {if switch x == set: then add 100 ore AND switch x = clear}
TRIGGER 2 FIRES, {player ore += 100, switch x = clear}

etc.
Report, edit, etc...Posted by Yossarian on 2005-10-19 at 19:27:49
Okay, guys, new problem:

I think it's because I'm using hyper triggers, but now when it gives money it gives more than the prescribed amount. My guess is that it's executing the trigger more than once because of the hyper triggers. Do you have any idea about how I might be able to fix it without having to get rid of the hyper triggers?
Report, edit, etc...Posted by DT_Battlekruser on 2005-10-19 at 19:31:37
Make it just for all players? According to your description, it is for all players, force one, and player 1. This would make three copies of the trigger for player one.
Report, edit, etc...Posted by Subrosian on 2005-10-19 at 19:37:12
hyper triggers arent affecting that trigger; in fact they're making it work better.

Read my post as well as Legacy's.

ADDITION:
DT_Battlekruser: Even if it was for all players, force 1, and player 1, it would still work.

ADDITION:
QUOTE(PCFredZ @ Oct 18 2005, 05:29 PM)
There's nothing wrong with his original trigger unless he suffers more than 1 death of marines at the same time.
[right][snapback]336608[/snapback][/right]

He used the condition "at least," so it should be fine if he suffered more than 1 at the same time. What he DIDN'T do is make it subtract 1 death instead of set deaths to 0.
QUOTE(GgG-PlayaR. @ Oct 18 2005, 04:36 PM)
in my trigger there are no actions which "set kills"
its really set minerals not kills look carefull lol
[right][snapback]336561[/snapback][/right]

Read my post above yours.
Report, edit, etc...Posted by LegacyWeapon on 2005-10-19 at 19:38:24
Triggers run one condition at a time and one action at a time and one trigger at a time. There are never 2 triggers running simultaneously.

First of all, you cannot set deaths for "Any Unit." It's just not possible.

Next, try to be more specific with your removal of deaths.

In the Hounds death trigger, put this:
Modify death counts for Current player: Set to 0 for Hounds.
Instead of this:
Modify death counts for Current player: Set to 0 for Men.

ADDITION:
Oh yeah, and delete that "2 deaths = 0 deaths trigger"
Report, edit, etc...Posted by Subrosian on 2005-10-19 at 19:41:04
QUOTE(LegacyWeapon @ Oct 19 2005, 05:38 PM)
Modify death counts for Current player: Set to  0 for Hounds.
Instead of this:
Modify death counts for Current player: Set to  0 for Men.
[right][snapback]337247[/snapback][/right]

Don't forget that you also have to subtract 1 death instead of set it to 0, or else if you kill more than one unit in a trigger cycle you'll only get the reward of one.
Report, edit, etc...Posted by RedNara on 2005-10-19 at 21:08:19
what Subrosian said is true.

becuase sometime with death i dont think they count them all i mean like especailly if you have a trigger going with them.
Report, edit, etc...Posted by Yossarian on 2005-10-19 at 22:59:35
Umm . . . I'd like to point a few things out:

1) The "All Players, Force 1, Player 1" thing was just there as a general example. The actual trigger will be working for each player, so it would actually be "Players 1~5 + 8".

2) That extra trigger that reset deaths when it got to 2 was just an experiment I was conducting to try to figure out the problem. Don't pay attention to it.

3) I did what you guys said; here's the trigger I have now:


Trigger
Description:
This is supposed to give you $200 every time a Rifleman (Ghost) dies.
Players:
¤ Player 1
¤ Player 2
¤ Player 3
¤ Player 4
¤ Player 5
¤ Player 8
Conditions:
¤ Current player has suffered at least 1 deaths of Rifleman: $100 (Ghost).
Actions:
¤ Modify death counts for current player: subtract 1 for Rifleman: $100 (Ghost).
¤ Modify resources for current player: add 200 ore.
¤ Preserve trigger.


I'll also attach the map again so you can see what happens for yourself, which is the same thing that happened before on a lesser scale. The sequence is, I kill one of my own ghosts, I receive 400 ore. I also tried putting the amount in the trigger to 100, in which case it gave me 300 ore. I have no idea why it does that, but my best guess, as I said before, was the hyper triggers. True, they supposedly make the triggers work better, but that's all I can come up with.

So, please take another look at the map, and even try them out yourself to see if they work.

[attachmentid=14625] Thanks again.
Report, edit, etc...Posted by LegacyWeapon on 2005-10-19 at 23:44:59
That's because you have an extra trigger in "All Players" for the rifleman that adds 200 and sets the deaths of "Men" to 0 which does not work.
Report, edit, etc...Posted by Yossarian on 2005-10-20 at 01:04:06
WOW!

Thanks a lot, guys. Legacy, you hit the nail on the head. I've redone all of the trigs, and it works beautifully. Now, on with the gaming . . .
Next Page (1)