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

Scenario Design and Discussion
Moderated by Sebastien, Mr Wednesday

Hop to:    
Welcome! You are not logged in. Please Login or Register.2 replies
Age of Kings Heaven » Forums » Scenario Design and Discussion » Ai question
Bottom
Topic Subject:Ai question
JackalRat
HG Alumnus
(id: BrandNewCar)
posted 12-11-02 07:15 AM CT (US)         
Hello,
It has been a while since I dabbled in Ai and wish to create a effectively "random" set of occorunces by percentages via the ai.

This is what I'm trying to do, as Captain Vimes approaches a group if a certain cloaked, cold character is there and he decides to play the game he loses, if the other percentage is chosen it removes the cloaked, cold character and if he enters the game it activates different triggers, and he wins.

I know this is fairly simple but I can't currently get my head around it.

A confused person .

Bill

AuthorReplies:
Pertti Susilainen
OD Loaf-ward
(id: Sukkit)
posted 12-11-02 02:25 PM CT (US)     1 / 2       
Hmmm, I'm not sure if I know what you mean

But anyway, this should work:

(defrule
(true)
=>
(generate-random-number 100)
)
;This will create a random number between 0 and 100. Note that the condition ["true"] could be set to, say, (event-detected trigger x), used with a trigger which would send signal x to the AI, for example, when there are Objects in Area, or Bring Object to Area, or something like this.

(defrule
(random-number >= 50)
=>
(set-signal y)
)
(defrule
(random-number < 50)
=>
(set-signal z)
)
;These two rules will check the above-created random number. If it's 50 or more it sends a signal y to the editor, and stuff happens. And the same with z.

I hope this helps
Also, I'm not checking my notes right now so small details might be wrong. However, I expect everything's OK


Hu seo rag gewat, genap under nihthelm, swa heo no wre
"As for the comment made by eithyddyswcitwr, could you please post back with better grammar that we can all understand, thankyou."
Winner of Sul's Most Obvious Comment Award
Tsunami StudiosWildfire Games
The Frankish Throne (4.6)
JackalRat
HG Alumnus
(id: BrandNewCar)
posted 12-11-02 03:22 PM CT (US)     2 / 2       
I'll give this a try, thanks .
You must be logged in to post messages.
Please login or register

Hop to:    

Age of Kings Heaven | HeavenGames