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

Scenario Design
Moderated by Yeebaagooon, nottud

Hop to:    
loginhomeregisterhelprules
Bottom
Topic Subject: About global variables
posted 23 October 2004 10:22 PM EDT (US)   
I read the global variables from TwentyOneScore's post... It quite amazed me, but i still dont understand maybe you can you can give me better instrustment or example. Im trying to make 1 gold per 1 kill. thanks for helping...

From pftq: How to make Kill-counter (exact)
" " = Name/Variable

===============================================

Trigger: Kill Setter
active, run immediately

Condition: QV Stat Value: P2's Enemies Killed => "Point", Value 1

Effect:
QV Set Stat Value "Kills"
Fire Kill Counter

This trigger counts how many kills you have.
===============================================

Trigger: Kill Counter
run immediately

Condition: QV Compare "Kills" => "Point"

Effect:
QV Set "KillsOld" to 0
QV Modify 2 "KillsOld" + "Kills"
QV Modify 2 "Kills" - "Point"
QV Modify 2 "Count" + "Kills"
QV Set "Point" to 0
QV Modify 2 "Point" + "KillsOld"
Fire Kill Setter

This Trigger adds new number of kills to the number of kills yet to be converted to gold.
===============================================

Trigger: Granter
loop, active, run immediately etc

Condition: QV Check "Count" => 1

Effect: QV Modify "Count" (-1)
Grant 50 Gold

This Trigger converts "Count"s to gold.
=================================================

The general idea behind that should work flawlessly, but I may have made a few errors writing it out (gave me a headache).

What it does is:

1) Records how many total kills you have.
2) When you have more than before, it subtracts the total kills by previous total kills. Then adds that number to your "Count".
3) When you have at least one count, you lost a count and get 50 gold.

*updated: Forgot two effects


[This message has been edited by rjs23 (edited 10-26-2004 @ 06:02 PM).]

Replies:
posted 24 October 2004 01:09 AM EDT (US)     1 / 25  
You don't need a global for that, you can do it with triggers. Something to do with a new condition the name of which escapes me at the moment, but yeah, you don't need globals, and I guess this wasn't very much help, but I do try, and I haven't been in the editor much in the past month, and this sentence is really starting to run on, so I'd better be wrapping it up.

_________________.##@@$$$@@##._____________
______________,##@$::%$$%%::$@##.__________
____________#@$:%%000000000%%:$@#_________
___________#@$:%00'___________'00%:$@#_______
__________#@$:%0'_______________'0%:$@#______
_________#@$:%0__________________0%:$@#_____
posted 24 October 2004 01:44 AM EDT (US)     2 / 25  
I said this before, but if oddy saw this...

Anyways, oddy made a whole guide on a one trigger kill counter. Check a few pages back. It's easy to spot.

posted 24 October 2004 03:43 AM EDT (US)     3 / 25  
Well, just use the search function .
posted 24 October 2004 08:11 AM EDT (US)     4 / 25  
what do you actually use global variables for, I have never seen a need for one.
posted 24 October 2004 09:25 AM EDT (US)     5 / 25  
that is what i need, but i want to know more about global variables and how to use them.
posted 24 October 2004 11:41 AM EDT (US)     6 / 25  
Do you want to know what a variable is, or do you know what it is but you want to know what you can do with global variables?

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 10-24-2004 @ 11:42 AM).]

posted 24 October 2004 01:52 PM EDT (US)     7 / 25  
I want to know what I can do with global variables.
posted 24 October 2004 08:52 PM EDT (US)     8 / 25  

I need help with kill counter. when i cast metoer on 3 units and killed 3 units but my gold increase to 50. It should be 150 ( 50 gold per one kills ).

Here my triger-
Condition-- quest value stat
fakeplayer-2
stat- ememy units killed
Operator->=
quest zeropoint-kills
value-1

Effect--grant resource
Player 2
Blah blah- gold
100
Effect-- qv stat value
varname-kills
fakeplayer-2
Stat type- Ememy unit kills

So is this right? or im doing wrong?

posted 24 October 2004 09:13 PM EDT (US)     9 / 25  
The global variables in scenarios were discoverded by TOS back before the addition of quest vars. So basicly you could use a global var any where you would use a quest var.
posted 24 October 2004 10:01 PM EDT (US)     10 / 25  
What oddy's trigger does is give the effect everytime your number of kills is a number more than before (in your case, one more than before), not for every certain number.

What's happening is the trigger reacts too slow. By then, you already killed more than needed, but it still gives you 50 gold.

Try setting it to High Priority - that should work. If it doesn't work or you want a flawless one, here's my trigger suggestion. Makes sure the effects are in the EXACT order.

" " = Name/Variable

It doesn't have to be High Priority or Run Immediately. You just get your gold faster if you do.
===============================================

Trigger: Kill Setter
active, run immediately

Condition: QV Stat Value: P2's Enemies Killed => "Point", Value 1

Effect:
QV Set Stat Value "Kills"
Fire Kill Counter

This trigger counts how many kills you have.
===============================================

Trigger: Kill Counter
run immediately

Condition: QV Compare "Kills" => "Point"

Effect:
QV Set "KillsOld" to 0
QV Modify 2 "KillsOld" + "Kills"
QV Modify 2 "Kills" - "Point"
QV Modify 2 "Count" + "Kills"
QV Set "Point" to 0
QV Modify 2 "Point" + "KillsOld"
Fire Kill Setter

This Trigger adds new number of kills to the number of kills yet to be converted to gold.
===============================================

Trigger: Granter
loop, active, run immediately etc

Condition: QV Check "Count" => 1

Effect: QV Modify "Count" (-1)
Grant 50 Gold

This Trigger converts "Count"s to gold.
=================================================

The general idea behind that should work flawlessly, but I may have made a few errors writing it out (gave me a headache).

What it does is:

1) Records how many total kills you have.
2) When you have more than before, it subtracts the total kills by previous total kills. Then adds that number to your "Count".
3) When you have at least one count, you lost a count and get 50 gold.

*updated: Forgot two effects

[This message has been edited by pftq (edited 10-24-2004 @ 10:50 PM).]

posted 25 October 2004 02:26 PM EDT (US)     11 / 25  
This problem will only occur when you kill more units exactly simultaneously.

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 25 October 2004 05:27 PM EDT (US)     12 / 25  
O i see. Im going to make another 2 kills counter with 5& 10 kills. Well i got another question about unit special attack.. is that possible to change unit special attack or normal attack by trigger? If so, please tell me how i do it.

[This message has been edited by rjs23 (edited 10-25-2004 @ 05:28 PM).]

posted 25 October 2004 05:45 PM EDT (US)     13 / 25  
No, it's not a REAL special attack - just an illusion. Try the search engine.. Wait, it's listed in the "Editor Tips and Tricks" thread.

rjs, if you are serious about exact numbers, then use what I posted - otherwise, use oddy's kill-counter as it's way easier.

Examples where it might miscount however are:

1) Much is happening and you kill many enemies.

2) Meteor God Power lands in a group of units.

etc etc.

posted 25 October 2004 08:58 PM EDT (US)     14 / 25  
Can you sent me the link of Editor Tips and Tricks? And how to make trigger link too.. Because i cant find "how to make a trigger" Nah i will use 500 gold per 10 kills instead, that will work. Thank anyway

[This message has been edited by rjs23 (edited 10-25-2004 @ 09:02 PM).]

posted 25 October 2004 09:08 PM EDT (US)     15 / 25  
Err, it's right below this thread. You can't miss it.

"Guide to Editor Tips and Tricks"


What do you mean by Trigger link?

[This message has been edited by pftq (edited 10-25-2004 @ 09:09 PM).]

posted 26 October 2004 05:25 PM EDT (US)     16 / 25  
O okay... lol.I means a guild that tells how to make a trigger from notepad.

[This message has been edited by rjs23 (edited 10-26-2004 @ 05:32 PM).]

posted 26 October 2004 05:48 PM EDT (US)     17 / 25  
YOu mean make your own effects/conditions?

Dr Nick's Advanced Trigger Guide

If you need to know how to use triggers, there's a guide in the Scen Design Library but I don't believe you're looking for that.

posted 26 October 2004 06:00 PM EDT (US)     18 / 25  
Yes that was i was looking for Dr Nick's Advanced Trigger Guide. thanks You're a pal

[This message has been edited by rjs23 (edited 10-26-2004 @ 06:01 PM).]

posted 27 October 2004 10:41 AM EDT (US)     19 / 25  
Hm, I think you should only try to make your own trigger members if you really know what you're doing. (For instance, learn C++ and XML first.)

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 27 October 2004 05:32 PM EDT (US)     20 / 25  
you mean i have to know how to use c++ and XML to make triggers? I dont know what c++ and XML means.
posted 27 October 2004 08:21 PM EDT (US)     21 / 25  
I think C++ is programming right? And xml are files that tell AOM the unit data etc.
posted 28 October 2004 01:30 PM EDT (US)     22 / 25  
Yeah. Here's some fun facts for you:

XML is a tag based extensible data language. Which just means that you can invent your own tags to work with whatever program your using. In AOMs case, the XML has tags like: <Effect> and <Condition>.

C++ is the worlds first (but definately not last) object oriented programming language which makes it slightly slower than C, but with serious advantages to the programmer including creation of classes (data structures that include function prototypes) and inheritance as well as some other really cool stuff like operater overloading.

Why should you know these? As I mentioned earlier, XML is the structure of the typetest.xml document that describes conditions and effects. The commands used for scripting these members (as oddy likes to put it) is in XS which is suprisingly similar to C, though it doesn't really have all the features by far.

EDIT: Here is a pretty good XML resource.


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 10-28-2004 @ 01:36 PM).]

posted 28 October 2004 03:18 PM EDT (US)     23 / 25  
Yup, you don't need to know any of these to make triggers, of course. That's why I like to keep it clear that triggers are not conditions and/or effects.
Furthermore: you don't really need to know both languages completely. My point is that, to make trigger members function immediately, you must have some 'feeling' for computer logic & language. Like you have to know French grammar before you can speak or write it correctly. If you want to make more complicated conditions/effects, it's almost neccesary to know what start tags, end tags, atributes (XML) and statements, expressions, operators, functions, variable types, return values, parameters, arrays and that stuff are. I've seen a lot of people who try to make an effect, realize it doesn't work and then ask me a few times why it doesn't work and how it will work; just because they do not really know what they're doing.
A sign of 'not really knowing what you're doing' is also, IMO, calling conditions & effects triggers (though it could be pure laziness too ). The principle of IF...THEN is not só very hard. Especially when new designers do it, it seems to me like they are a bit capable of using triggers, but not (yet) at understanding triggers.
Phew, I'm getting philosofical (if that's the right word).

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 10-28-2004 @ 03:25 PM).]

posted 28 October 2004 08:12 PM EDT (US)     24 / 25  
I stared reading Dr Nicks link to xml it is very intresting. I could ask alot of questions here, but I guess ill keep reading. Thanks guys.
posted 30 October 2004 10:06 AM EDT (US)     25 / 25  
okay i see, understanding xml is pretty hard to me. They got so many things on the website... interesting...

[This message has been edited by rjs23 (edited 10-30-2004 @ 10:10 AM).]

Age of Mythology Heaven » Forums » Scenario Design » About global variables
Top
You must be logged in to post messages.
Please login or register
Hop to:    
Age of Mythology Heaven | HeavenGames