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

Scenario Design and Discussion
Moderated by Sebastien, Mr Wednesday

Hop to:    
loginhomeregisterhelprules
Bottom
Topic Subject: How do you use the "AI SIGNAL" Condition?
posted 04-10-01 11:33 PM CT (US)   
How do you use the AI SIGNAL" condition in the triggers editor?

The options are just a list of numbers, do these represent "goals" in the AI script?

Example, if I set (goal 1) to be true if the computer player makes it to the Imperial Age, and set a trigger in the editor with the condition AI SIGNAL 1, will it go off?


Too Weird to Live, Too Rare to Die...

-Designer of Adaptatron AI-
-Designer of Canute's Saga-
-Winner, Heroes of the Ages Contest-

Replies:
posted 04-11-01 08:09 AM CT (US)     1 / 15  
They are signals set in the AI with the set-signal command.

Programmer on 0 A.D., author of Norse Wars, co-author of Fort Wars.
posted 04-11-01 11:19 AM CT (US)     2 / 15  
Matei,

Do you know of an AI that uses these? Can the signal be shut off, does it stay on, or is it a one time event?

Here's the idea, I want to set up a random number generator in the AI that will send its results via a signal to the map triggers, causing the game to be different every time you play (causing the CP to take different paths).

Thanks for the info..


Too Weird to Live, Too Rare to Die...

-Designer of Adaptatron AI-
-Designer of Canute's Saga-
-Winner, Heroes of the Ages Contest-

posted 04-11-01 03:01 PM CT (US)     3 / 15  
I don't know any AI that uses these, but you can sure make one .

Unfortunately, these signals cannot be turned of . However, there are lots of them so you can still use the random-number thing. For example, maybe the map has a feature that the player starts in the North corner, or the south, or so on. You'll need one of four signals to use (1=north, 2=south, etc). Say theres also a feature that the enemies start sometimes with cavalry and other times with infantry. You'll need two signals to use (for example 5 and 6). With more than 100 signals available, you could have many different random things happening. Unfortunately, you can't use a signal and then turn it off and maybe send it again later, so this may limit you a bit.

Instead, however, you can use resources to send signals. For example, if your AI cannot get stone, but you want it to send a signal when it's attacked or something, use :


With this, you have a re-usable "signal" if you need one.

AI RULE:
(defrule
(town-under-attack)
=>
(cc-add-resource stone 1)
)

TRIGGER: looping=yes, objective=no, starting=on
condition: accumulate attribute (your AI) (stone stockpile) (1)
effect: tribute (your AI) (Gaia) (1) (stone stockpile)
effect: [whatever else you want]



Programmer on 0 A.D., author of Norse Wars, co-author of Fort Wars.
posted 04-11-01 03:18 PM CT (US)     4 / 15  
Matei,

On another note, do you know of a way to increase the player's resources, without it being a tribute from another player? More importantly, I'm trying to have the player get gold for taking down a building, but I dont want that annoying 'GAIA tributes 100 gold to you' chat..

I just want his recource the get higher by the amount I want, with no screen clutter. Any ideas?


Too Weird to Live, Too Rare to Die...

-Designer of Adaptatron AI-
-Designer of Canute's Saga-
-Winner, Heroes of the Ages Contest-

posted 04-11-01 03:26 PM CT (US)     5 / 15  
About the random generator this is how it looks and works:

; This generates a number between 1-10.
(defrule
(true)(here you can have whatever fact you need)
=>
(generate-random-number 10)
(disable-self)
)

If I understand your idea right it can look like this:

; this is a 70/30 outcom generator.

(defrule
(random-number < 8)
=>
(set-signal 1)(to a trigger "A")
(disable-self)

(defrule
(random-number > 7)
=>
(set-signal 2)(to a trigger "B")
(disable-self)

Do you follow???

The generate-random-number action add a nice touch to your AI and by the randomness it prevents the player of the scenario to learn what actions the C.P will take in the game...


EraserHead

Author of -The Lonesome Raider- In progress -The Ice Storm-
ES Contest -The Harald Hardraade Saga-
"Qld hefr afrad goldit illt. Nu kvedk her stilltan."

[This message has been edited by EraserHead (edited 04-12-2001 @ 03:00 PM).]

posted 04-11-01 03:56 PM CT (US)     6 / 15  
To Matei.

Arrgh I cannot believe it, you are indead right about the turn off thing.


EraserHead

Author of -The Lonesome Raider- In progress -The Ice Storm-
ES Contest -The Harald Hardraade Saga-
"Qld hefr afrad goldit illt. Nu kvedk her stilltan."

[This message has been edited by EraserHead (edited 04-12-2001 @ 03:34 PM).]

posted 04-11-01 05:14 PM CT (US)     7 / 15  
Eraserhead,

So when you diable the set-signal script, it only sets that signal for a moment of time, or will that signal be (true) forever after that point?

My worry is that the trigger in the scenario might miss the signal if its transient.

Just want to get this straight in my head. Thanks for the advice.


Too Weird to Live, Too Rare to Die...

-Designer of Adaptatron AI-
-Designer of Canute's Saga-
-Winner, Heroes of the Ages Contest-

posted 04-12-01 02:46 AM CT (US)     8 / 15  
UnDiscoveredBum.

As you probably seen already the signal is sent throughout the game as soon as it is set...and by the way in your case it is quite good because it reduces the changes for missing the signal to zero...


EraserHead

Author of -The Lonesome Raider- In progress -The Ice Storm-
ES Contest -The Harald Hardraade Saga-
"Qld hefr afrad goldit illt. Nu kvedk her stilltan."

[This message has been edited by EraserHead (edited 04-12-2001 @ 03:38 PM).]

posted 04-12-01 07:01 AM CT (US)     9 / 15  
If you wanna get rid of the message that Gaia tributed 100 gold to the person, make an effect in the same trigger "remove instructions". I have never done this, its just an idea. Might not even work.
posted 04-12-01 07:35 AM CT (US)     10 / 15  
I don't know about the disable-self, that should just disable the AI rule. But, I'll try it. About the chat message from GAIA, just use a send chat effect with a blank message about 8 times after, and the GAIA message will go right off the screen.

By the way, how do you give GAIA resources? I thought it lost all at the beginning...


Programmer on 0 A.D., author of Norse Wars, co-author of Fort Wars.
posted 04-12-01 07:43 AM CT (US)     11 / 15  
EraserHead,
I tried your method with disable-self, and I had a looping trigger on my map that sends chat "Signal" when the signal is on, but it kept on doing this even though the rule disabled so there is no way to turn off a signal. The disable-self command only turns off the rule, but the signal, once set, is global and unnafected by this.

I'm still wondering how you get GAIA to have resources...


Programmer on 0 A.D., author of Norse Wars, co-author of Fort Wars.
posted 04-12-01 12:06 PM CT (US)     12 / 15  
Im not sure about the GAIA resource thing.. I just gave him lots in the editor, and he was able to tribute to my player the necessary amount of gold. I've heard of problems with GAIA having resource but I forget the particulars.

The Clear Instrustions command might get rid of the tribute chats, it would be there so fast no one would pick it up.

I'll try it out.

Maybe I'll even announce the scenario that this realtes to, its nearing completion, and its pretty different than most stuff out there, but I think it retains the AOK historical feel (not an RPG, not really a straight B+D...)


Too Weird to Live, Too Rare to Die...

-Designer of Adaptatron AI-
-Designer of Canute's Saga-
-Winner, Heroes of the Ages Contest-

posted 04-12-01 02:21 PM CT (US)     13 / 15  
Sound interesting. Maybe it's like Final Hour... That'd be fun!

I'll try giving GAIA 99999 of each resource to see what happens. I usually have an enemy comp give resources and have a relic so it gets more.


Programmer on 0 A.D., author of Norse Wars, co-author of Fort Wars.
posted 04-12-01 03:21 PM CT (US)     14 / 15  
Matei.

At some rare times one have to admit an error and this is such a time, of course you are right and I should have remembered it because of the amount of set-signal actions I used in my scenario...

UndiscoveredBum.

Hope I have not caused so much trouble to you...

But this is of course what the forum is ment for... to learn something new and hopefully correct methods for better scenario design.

Pretty embarrasing this one but what the h**k you cannot always be right even if you supposed to be good at AI writing...

[This message has been edited by EraserHead (edited 04-12-2001 @ 03:46 PM).]

posted 04-12-01 06:10 PM CT (US)     15 / 15  
You can. however, turn off the signals in the other direction, not that it would help in this case.

Phoenix_ER - proud member of the Phoenix Clan
Age of Kings Heaven » Forums » Scenario Design and Discussion » How do you use the "AI SIGNAL" Condition?
Top
You must be logged in to post messages.
Please login or register
Hop to:    
Age of Kings Heaven | HeavenGames