PDA

View Full Version : Trigger question for all of you mod geniuses


cassius987
01-05-2007, 4:16 PM
Hi WarBoards (to which I am new)... I am but a wee little OSX user trying to make a fun UMS map based on the old Special Forces kill 'em all theme. But I'm making the map from scratch so I can do much trigger lifting. One thing I am trying to replicate is the way these maps allow the player to accumulate points, then cash them in for minerals. But it's giving me trouble.

I think that something is wrong, because one part of my trigger script says that when a player kills a certain unit he gets a certain number of points. Obvious right? But perhaps because of the preserve command, I then continue to get points (undeserved) for several minutes, then they stop entirely even I start killing again. THEN if I kill a unit of a type that I haven't killed yet it starts all over again.

In order to program this process, I thought I would do it by making a trigger for each potential killed unit. For instance, a trigger for the Broodling, Zergling, Hydralisk, and so forth. This allows me to give each unit a unique point value. Anyways, here's the way I've been writing them, and the way they are written in whenever the aforementioned bugs occur:

Players:
Terran Special Forces (this is P1-P6)
Conditions:
Current Player kills exactly 1 Zerg Zergling.
Actions:
Add 75 Custom to Current Player.
Preserve Trigger.

And so on... To me, nothing should be going wrong, because to meet the preserve trigger conditions and continue getting points I should also have to continue killing. Yet this is not the case, and then of course there is the problem of the trigger shutting down entirely after a few minutes and giving me no points no matter what. Serioiusly, what is the deal???

As I have said, I operate on OSX. As far as I know, the only decent editor for OSX to date is Blizzard's StarEdit, as feeble as it is. Much of the third party software I have found for OSX actually won't run, because Blizzard did not provide a StarEdit carbon in the last patch from which the third party programs could operate. So if you know of a third party that would work, please tell me...

Or better yet, if you just know what I'm doing wrong in StarEdit please tell me!

Thanks so much.

matefkr
01-05-2007, 5:34 PM
I'm not genious, but you may can find one important information:

You can make this trigger just for a multiple number (so not infinite number). There are some data bytes in memory, about the players' statistics. This bytes will have been modified as you kill units, or do something, that matter. The kills condition get the data from this list. With staredit, you can't modify this statistic list...

If you see, that a trigger like this stop to work, the reason may be a variable in memory, or something, which reached the maximum number. In this case you may have a chance.. ( i will look after later).

cassius987
01-07-2007, 10:59 PM
Well... thank you but I don't think that's the problem as it occurs immediately (thus no memory has been used up). Anyone else?

TheNomad
01-08-2007, 7:27 AM
lol...it doesn't have to do with memory being filled up. It's about the game's logic... since the kill amount is always "at least X", it will fulfill the action.

This is how to do it:


Player:
- Whomever...
Condition:
- Current Player Kills is at least X <Whatever Unit>
Action:
- Modify Score for Current Player:Set to 0 Kills
- Modify Score for Current Player:Add X Custom
- Preserve Trigger

If you use "Current Player" than you can just check the box to the Players you want so that you don't have to copy-paste this for all of them. Also, when using the Leaderboard, make sure you remove the Computer Players from it so that we don't see the "0" of the AI which will prolly be the target anyway :D

azzhair
01-08-2007, 7:03 PM
Player:
- Whomever...
Condition:
- Current Player Kills is at least X <Whatever Unit>
Action:
- Modify Score for Current Player:Set to 0 Kills
- Modify Score for Current Player:Add X Custom
- Preserve Trigger
ok iam no smart ass at triggers but ive made a few maps but if u reset the kill to 0 then that means the trigger should repeat over and over... try something like
- when player red(or all players) kills exactly 1 of zergling
action
add X to leader borad
perrsive trigger or how ever u spell it

when player RED brings one of any unit to location money
modifty rescoures by X minerals and or gas
modify leaderborad -X points
? would that work? its some what like comp programing but i realy dont wanna work on it to much righte now dinner

TheNomad
01-08-2007, 7:42 PM
ok iam no smart ass at triggers but ive made a few maps but if u reset the kill to 0 then that means the trigger should repeat over and over...

That is the point. The point is for the TRIGGER to repeat over and over (his intention) not just the ACTION (his problem). What I told him should work and is what most use instead of doing something between 1 and 100 units for each player or race...

And that "programming" you speak of is done with death counters, not resources. And the leaderboard thingy will work properly if done as I suggested. Yours is too complicated and I am not sure it'd work since you wrote it pretty vaguely.

Yossarian7
01-09-2007, 9:31 PM
Player:
- Whomever...
Condition:
- Current Player Kills is at least X <Whatever Unit>
Action:
- Modify Score for Current Player:Set to 0 Kills
- Modify Score for Current Player:Add X Custom
- Preserve Trigger

That poses a problem if multiple units are killed at the same time. Also, I advise you against dealing with kills in the conditions and kill scores in the actions. You should use the same measure in both, imo. The following is my proposition.

Conditions:
- Current player's score is at least X
Actions:
- Modify score for current player: subtract X
- Modify resources for current player: add Y
- Preserve trigger

The problem with multiple units dying simultaneously can also be solved by using hyper triggers, which make StarCraft check the conditions constantly instead of every two seconds. Read more about that here: http://staredit.net/index.php?tutorial=49.

Of course, you can replace resources with a custom score if you want. It doesn't really matter; it depends on what you want to do with that value in other triggers.

cassius987
01-10-2007, 4:46 AM
I've been told a couple of times about hyper triggers... is that tutorial suggesting I use basic staredit to make the hyper triggers or a third party? I guess I fail to understand how telling the computer to wait 0 ms over and over makes anything go faster, but I will try this. Also, I'm testing out the "set kill score to 0" theory for my triggers as I type this and will try to report back soon.

TheNomad
01-10-2007, 8:12 AM
It's because "Wait" commands basically tell the engine to skip to other triggers of other players. Therefore, using a lot of waits on the computer will tell the engine to perform other triggers faster.

Yossarian7
01-11-2007, 12:00 AM
I've been told a couple of times about hyper triggers... is that tutorial suggesting I use basic staredit to make the hyper triggers or a third party? I guess I fail to understand how telling the computer to wait 0 ms over and over makes anything go faster, but I will try this. Also, I'm testing out the "set kill score to 0" theory for my triggers as I type this and will try to report back soon.

GAH! No, no, no! Use "subtract X kills" instead. Otherwise, like I said, if you have two units die simultaneously, it'll only give you the resources or w/e for one.

TheNomad
01-11-2007, 7:49 AM
Thought I said to "subtract kills", while you said "subtract score" :P

Anarcy
01-11-2007, 8:36 AM
I asked the same question, but did not get a good result.

Say which solution works please.

TheNomad
01-11-2007, 2:29 PM
Both should work, depending on what you need.

Anarcy
01-14-2007, 6:35 AM
I used Yossarian7 way.
It works pretty good.

Only bad thing is, you have to know how much killpoints each unit gives.
Checking this in DatEdit is annoying.
Another bad thing: If 2 units give the same amount of killpoints (like Broodling and Zergling)

Well, but it works and im very happy now ;)

cassius987
01-17-2007, 5:54 PM
I found an easy out...

Simply set a "Kills and Razings" lead board and the editor has a per unit type value system already installed. Although you can't mess with it. As to these other ideas, I have tried and tried to little avail. However I have a hunch that modifying Kills and Razings instead of Custom would produce better results if you wanted non-kill numbers, or else do an add kills formula (Ultra +3 kills, etc.). Anyways. Just making my report.

Tbone
01-22-2007, 2:10 PM
Player:
- Whomever...
Condition:
- Current Player Kills is at least X <Whatever Unit>
Action:
- Modify Score for Current Player:Set to 0 Kills
- Modify Score for Current Player:Add X Custom
- Preserve TriggerThat poses a problem if multiple units are killed at the same time. Also, I advise you against dealing with kills in the conditions and kill scores in the actions. You should use the same measure in both, imo. The following is my proposition.

Conditions:
- Current player's score is at least X
Actions:
- Modify score for current player: subtract X
- Modify resources for current player: add Y
- Preserve triggerThe problem with multiple units dying simultaneously can also be solved by using hyper triggers, which make StarCraft check the conditions constantly instead of every two seconds. Read more about that here: http://staredit.net/index.php?tutorial=49.

Of course, you can replace resources with a custom score if you want. It doesn't really matter; it depends on what you want to do with that value in other triggers.

Yea thts right but there is a certain amount of points for every unit so if you kill a battle crusier i think u get 4000 kill points so u may have to use a mod program to make the kill points 1 each unit that is in the game. I prefer dat edit its in SC.org

Also this might work
Conditions: Players kill score is_____
Actions: Modify players kill score set to 0
Create __ of ____ unit
Preserve trigger
that might work