You must be logged in to post messages.
Please login or register

Scenario Design
Moderated by Yeebaagooon, nottud

Hop to:    
loginhomeregisterhelprules
Bottom
Topic Subject: Guide To Make An EASY Kill Counter (only 1 trigger!)
« Previous Page  1 2  Next Page »
posted 13 August 2004 04:17 PM EDT (US)   
Guide to make an Easy kill counter
| ===================== |

1. Introduction

A few months ago, I developed two trigger members* (1 condition and 1 effect) to make a Stat Value counter using only one trigger. (You hear that? One!) The two trigger members came with the SNXT2 (Some New X Triggers 2), composed by Reyk. I explained how to use it dozens of times in various threads, but my posts about this feature were mostly ignored. That's why all of you can now read about this amazing solution in a new guide.

*Trigger members: a term I created that covers both conditions and effects.


2. Requirements


  • AoM:TT (Chocolate).
  • A little Quest Var knowledge. (Try this good guide by DrNick.)
  • Some New X Triggers 2.
  • QV Set Stat Value (effect) and QV Stat Value (condition). These come with SNXT2, but some people may have got it from me personal.


3. Theory

Let's say you want to grant a player something if he has killed a certain amount of units. No problem, you can use Stat Value -> kills. That's simple.

Let's say you want to grant a player something every 10 kills that he makes. That's tricky, and it requires a complex solution with lots of OR-red conditions. If you want to start counting at a certain point in the gameplay (and not from the start), you certainly have a problem.
But not anymore! The solution to this problem lies in the combination of Stat Values and Quest Vars.

(The following information is not fool-proof and is only useful if you can fully understand the way a trigger works.)

This is the simplified* code of the normal Stat Value condition:

IF stat equals x THEN [effects]

stat is the current stat of the player (e.g. Kills). x is the count you fill in in the condition. If you want something to happen if the player's kill count equals 200, the trigger will work if stat equals 200.

The problem is that you have to give an absolute value as x (a number that is defined during designing and not during gameplay). But what we want is this: the trigger must work if x is 10 more than the previous kill count.

I found a way to accomplish that. It would make the code like this:

IF stat - p is-equal-or-greater-than x
THEN
[effects]
[update p]

stat is again the current stat value count (Kills in our example, x is the repetitive value ("every x kills...") and p is the previous kill count! And in my solution, it is a Quest Var.

Before the counter is started, the Quest Var will be updated so that it contains the number of kills at that point of the gameplay. The special condition in the looping trigger will constantly check if the actual kill count minus the previous registered kill count is the value that the designer filled in (it's 10 in our example). Of course, a higher value will be counted too (if the player kills 2 guys at once and the kill count doesn't 'hit' 10). (Remember: actual kill count - previous registered kill count = kill count since registration!)

In the same trigger is an effect that updates the Quest Var to the current kill count.

QV Stat Value is the condition that checks the stat as described before. It uses a Quest Var (that I like to call Point Zero) as p, the previous kill count.
QV Set Stat Value** is the effect that can update the Point Zero Quest Var. In general, it gives a Quest Var the value of a Stat Value.

Let's get practical - if you don't get the theory, don't worry, the actual trigger is very easy.

*Of course, the real code is much more complicated.
**A better name is QV Set as Stat Value; the effect doesn't actually set the Stat Value or something.


4. Let's make the trigger

If you didn't read the theory (or just scanned it over) but are good at triggers, please read and try to understand it now.

This is the trigger scheme. NOTE: The first trigger is optional: use it only if you start the counter "somewhere in the game" and not from the start of the game.


TRIGGER 1 (Optional)

Conditions

[What you like - the conditions to start the counter, for example]

Effects


  • QV Set Stat Value

    1. QVName: The name for your Quest Var that will remember the previous kill count. I suggest "PointZero", but the name is free, of course.
    2. Player: The player you want.
    3. Stat Type: Any type you want, but most common Kills.

  • Fire Event
    Trigger 2


TRIGGER 2


Loop

Conditions


  • QV Stat Value

    1. Player: The player you want.
    2. Stat Type: Any type you want, but most common Kills.
    3. Operator: Use >=.
      (If you've read the theory: >= stands for is-equal-or-greater-than. You can use other operators too: that could give things like "IF stat - p is lower than x THEN".)
    4. QV Point Zero: The Quest Var that you use to remember the previous kill count (same as in Trigger 1).
      (The p in the theory.)
    5. Value: The kill count you want the condition to check ("Every x kills...").
      (The x in the theory.)

  • Timer
    (I suggest 1 second.)

Effects


  • [All the effects you want]
  • QV Set Stat Value

    1. QVName: Same Quest Var as used in the QV Stat Value condition.
    2. Player: Same player as used in the QV Stat Value condition.
    3. Stat Type: Same stat as used in the QV Stat Value condition.



The effects of the trigger could e.g. modify a protounit or grant other units. Remember, these effects are executed every x kills that the player makes.


5. Advanced

There are various other things you can do using this technique besides a kill counter.
Examples:


  • You can count other stats as well.
  • You can use a different operator than >=.
  • You can make something random happen using a random Quest Var.


6. Conclusion

The theory behind the easy kill counter is a bit complicated. The practical use, however, is quite simple. If you just use the trigger scheme, your counter is ready. Remember: it's only one trigger! If you have any additions, please post it.

Happy designing,

Oddy.


A condition is not a trigger.
An effect is not a trigger.
A trigger is a combination of one or more conditions and effects.
It causes effects to happen if and when conditions are met.
Period.

[This message has been edited by oddy (edited 08-16-2004 @ 04:01 AM).]

Replies:
posted 13 August 2004 04:23 PM EDT (US)     1 / 31  
Excellent guide. I didn't read through it completely but I skimmed through the most important parts. I could use this for my scenario.

I was actually updating experience by awarding awarding a "iron weapons" tech, for example, every time you completed a mission- but this sounds like a better way if I can get it to work.

So, thanks again. Glad to see some great people populating the forums these days..really, people tell me their are 'noobs' around but I don't see them. All I see is talent, talent and more talent.

posted 13 August 2004 04:48 PM EDT (US)     2 / 31  
Great guide oddy, a good comeback . I even read through the whole thing although I knew the technique before. Good one, a real accomplishment for the community .

Quoted from oddy:

(You hear that? One!)


lol

Quoted from Pompey Magnus:

Glad to see some great people populating the forums these days..really, people tell me their are 'noobs' around but I don't see them. All I see is talent, talent and more talent.


Then you must be blind . Concerning 'these days', oddy is an old member of our community, he always had a huge knowledge.

EDIT, OT: Oddy, have you dropped your campaign? I personally have given up scn design, too... If you haven't, let me know about any progress.

[This message has been edited by AoMPlayer000 (edited 08-13-2004 @ 04:50 PM).]

posted 13 August 2004 04:57 PM EDT (US)     3 / 31  
Summary of this thread: Add 1 to a QV for every kill.

I didn't even read the thread, but look how brief I can be.


_________________.##@@$$$@@##._____________
______________,##@$::%$$%%::$@##.__________
____________#@$:%%000000000%%:$@#_________
___________#@$:%00'___________'00%:$@#_______
__________#@$:%0'_______________'0%:$@#______
_________#@$:%0__________________0%:$@#_____
posted 13 August 2004 05:04 PM EDT (US)     4 / 31  
phew, just finished reading it, nice guide

(¯`-.Proud Member of Ambition Designs and professer at Tsuniversity.-´¯)

Curent projects:
The Job 25% Complete Hot

Antisbackfiles.tk
For a guide on how to make WMV trailers for you campaign click Here

posted 13 August 2004 05:09 PM EDT (US)     5 / 31  

Quote:

Add 1 to a QV for every kill


The point is, how do you check if the player made a kill? Stat Value only counts all kills. See, one can't make it that short (unfortunately).
posted 13 August 2004 06:13 PM EDT (US)     6 / 31  
Poor Oddy. They ignore him and he's forced to write a guide. Well worth it though!

We never ignored your posts, it's just that the last post wasn't written as nicely as this guide. Good job.

Though I've never had occasion to use a kill counter, nice to know there is a well-written article for reference. I've cut and pasted it in my own editor library for reference. Thanks for sharing that with us.

posted 13 August 2004 06:25 PM EDT (US)     7 / 31  
Great guide .

I'm a noob


Where be your gibes now? your gambols? your songs?
Your flashes of merriment, that were wont to set the table on a roar?
Not one now, to mock your own grinning?

[This message has been edited by DrNick (edited 08-13-2004 @ 06:26 PM).]

posted 13 August 2004 06:30 PM EDT (US)     8 / 31  
great guide

(¯`·.¸¸.·>§σŕçęŕõŕ øƒ Σŕεbùś<·.¸¸.·´¯)
Professor for the Tsuninversity
Teacher for the NDA
Moderator At Age Quest
posted 13 August 2004 07:09 PM EDT (US)     9 / 31  
Great Guide.

I've been on these forums for a LONG time, so i'm no noob...


"You can't look dignified when your having fun" Wes Janson- Star Wars X-Wing: Solo Command

[This message has been edited by KaStOr_55 (edited 08-13-2004 @ 07:09 PM).]

posted 13 August 2004 07:34 PM EDT (US)     10 / 31  

Quote:

I've been on these forums for a LONG time, so i'm no noob...


what the!!???? why did you say that for


(¯`·.¸¸.·>§σŕçęŕõŕ øƒ Σŕεbùś<·.¸¸.·´¯)
Professor for the Tsuninversity
Teacher for the NDA
Moderator At Age Quest
posted 14 August 2004 06:20 AM EDT (US)     11 / 31  
Exelent guide

This "1 Trigger Kill counter" has already been used for ages though. NW 6.3.1 and Higher Have this 1 trigger KC in it.


PS2MAN
The Mythod Clan Burns To Ashes
Long Live The Phoenix!!!!
Phoenix_PS2MAN an Norse Wars Expert

Currently Recuriting Experienced NW UK Players.
posted 14 August 2004 06:26 AM EDT (US)     12 / 31  
Interesting way's peeps r getting around kill counters these days,
Gd work oddy! Although QVs are a little too complex for me, I havn't mastered em,
But there are still interesting ways to get units to lvl up in games
posted 14 August 2004 06:45 AM EDT (US)     13 / 31  
Thanks for the reactions! Maybe I'll submit another guide soon.

A condition is not a trigger.
An effect is not a trigger.
A trigger is a combination of one or more conditions and effects.
It causes effects to happen if and when conditions are met.
Period.
posted 14 August 2004 06:52 AM EDT (US)     14 / 31  
So what you're saying is that this trigger is like the kills ration trigger in aok?

Leader of Liquid Fire. Animator Seb C.

One does not simply leave HG
posted 15 August 2004 08:20 AM EDT (US)     15 / 31  
*awaits answer*

Leader of Liquid Fire. Animator Seb C.

One does not simply leave HG
posted 15 August 2004 10:33 AM EDT (US)     16 / 31  
Don't remember what that was.

A condition is not a trigger.
An effect is not a trigger.
A trigger is a combination of one or more conditions and effects.
It causes effects to happen if and when conditions are met.
Period.
posted 15 August 2004 10:37 AM EDT (US)     17 / 31  
eg: Every # kills condition

Like in aok rpgs you had a kills ratio condition ie: every 1 kill you get more HP


Leader of Liquid Fire. Animator Seb C.

One does not simply leave HG
posted 15 August 2004 11:44 AM EDT (US)     18 / 31  
An other Advanced option:

Add to Trigger 2 an Condition

QV Check
< 10

And Add an effect

QV Modify
"name"
+ 1

so after 100 kills it will stop.

And you can make if is >= 10.
To give better rewards

posted 15 August 2004 11:59 AM EDT (US)     19 / 31  

Quote:

(only 1 trigger!)

Am I the only person who counts two triggers? I mean, I'm pretty caffinated right now (long story), but I'm thinking it would take a lot of coffee to make two triggers = one trigger.


_________________.##@@$$$@@##._____________
______________,##@$::%$$%%::$@##.__________
____________#@$:%%000000000%%:$@#_________
___________#@$:%00'___________'00%:$@#_______
__________#@$:%0'_______________'0%:$@#______
_________#@$:%0__________________0%:$@#_____
posted 15 August 2004 02:59 PM EDT (US)     20 / 31  
Hmm, maybe I need to explain that too: in other solutions for this problem, you have to make one trigger for every possible kill count (10 kills, 20 kills, 30, 40, 50... etc.). Using this technique, you only need 1. I was a little enthousiastic when I wrote the title. If you don't have to start the counter "somewhere in the game", you can leave the first trigger.

@ RiderOfEternity: Yep.


A condition is not a trigger.
An effect is not a trigger.
A trigger is a combination of one or more conditions and effects.
It causes effects to happen if and when conditions are met.
Period.
posted 26 August 2004 09:41 AM EDT (US)     21 / 31  
Wow, weird (sorry for the bump)!

I just wrote (well 1-2 weeks ago)nierly the same guide without knowing about this (http://oddworldjunkie.com/ambition/index.php?code=artical_killcounters


I think FOG.

[This message has been edited by Villi (edited 08-26-2004 @ 09:43 AM).]

posted 26 August 2004 09:52 AM EDT (US)     22 / 31  
Damn I can't install the triggers for some reason

Leader of Liquid Fire. Animator Seb C.

One does not simply leave HG
posted 26 August 2004 12:35 PM EDT (US)     23 / 31  
Learn yourself to say "conditions and effects" or "trigger members". What's the problem with installing?

A condition is not a trigger.
An effect is not a trigger.
A trigger is a combination of one or more conditions and effects.
It causes effects to happen if and when conditions are met.
Period.
posted 26 August 2004 02:20 PM EDT (US)     24 / 31  
If they don't appear, open and save the typetest (xml I think) file in:

Program Files/Microsoft Games/Age of Mythology/trigger2

I have Titans so I'm not sure if this'll work if you have the original.

If you have the original, open and save the typetest in trigger (no number at end).

posted 26 August 2004 03:47 PM EDT (US)     25 / 31  
Great Guide, only one problem.

I cannot find "QV Stat Value" in the conditions list, and "QV Set Stat Value" on the effects list. I've downloaded the New X Triggers.

« Previous Page  1 2  Next Page »
Age of Mythology Heaven » Forums » Scenario Design » Guide To Make An EASY Kill Counter (only 1 trigger!)
Top
You must be logged in to post messages.
Please login or register
Hop to:    
Age of Mythology Heaven | HeavenGames