Post Pacific  

Go Back   Post Pacific > Восстановленный архив > Темы без сохранившегося раздела
FAQ Community Calendar Today's Posts Search

Notices

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 03.12.2005, 11:53   #1
krapno
Архивный участник
 
Join Date: May 2005
Posts: 368
Default AI, func[rand] usage and conditions

hello,

i am looking to understand how func[rand] works and how to use it with conditions, here the algo i want to do:

Select a random integer between 0 and 3 (i dunno if it is correct)
if result <=1 goto L1
if result =2 goto L2
if result >=3 goto L3


and here the syntax i suppose i have to use with AI:
Code:
L0
	push_parameter 3 // 0 to 3 ? 1 to 3 ?
	func_call 55   // func[Rand]

	push_const 1   // if result <= 1
	less_equal     // goto L1
	jump L1

	push_const 2   // if result = 2
	equal          // goto L2
	jump L2

	or

	push_const 3   // if result >= 3
	equal          // goto L3
	jump L3

	or
//---------------------------------------
L1
	(FUNCTIONS)
	jump L4 // goto end
L2
	(FUNCTIONS)
	jump L4 // end end
L3
	(FUNCTIONS)
	jump L4 // end end
//---------------------------------------
L4
	(EXIT HANDLER)
i dunno if it is correct and i would like to know, if it is possible, how to save the result of func[Rand] in a variable to use it in my FUNCTIONS parts for example.

Tx for your help
krapno is offline  
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 22:38.