Post Pacific  

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

Notices

 
 
Thread Tools Search this Thread Display Modes
Old 08.02.2006, 01:50   #1
Kirikups
Архивный участник
 
Join Date: Oct 2005
Posts: 175
Default AI and level controls

Hello,

i have a little problem compiling a part of a code:

Code:
class MyClass : ParentClass
{
parameter:
	float MyVar = 50;


handler:
	EventHandler SPELLED(speller, skill_name_id) 
	{ 
		if ((myself.sm.level / speller.level) < 1) {
			MyVar = MyVar * (myself.sm.level / speller.level);
		}
	
	}			
}
i get an error on the line:

Code:
MyVar = MyVar * (myself.sm.level / speller.level);
wtf, i want to decrease MyVar is PC is higher level than NPC... Impossible ?? Ty for any help
Kirikups is offline  
Old 08.02.2006, 03:33   #2
hr
Архивный участник
 
Join Date: Jun 2005
Posts: 285
Default

you can't change parameters, use built-in variables instead
hr is offline  
Old 08.02.2006, 05:54   #3
archy
Архивный участник
 
Join Date: Mar 2005
Posts: 280
Default

handler:
EventHandler SPELLED(speller, skill_name_id,c1)
{
if ((myself.sm.level / speller.level) < 1) {
c1 = c1 * (myself.sm.level / speller.level);
}

}
}
archy is offline  
Old 08.02.2006, 11:29   #4
Kirikups
Архивный участник
 
Join Date: Oct 2005
Posts: 175
Default

tx for your answer
Kirikups is offline  
Old 08.02.2006, 13:23   #5
hr
Архивный участник
 
Join Date: Jun 2005
Posts: 285
Default

actually cX are CreatureData variables, you should use fX variables in this example
hr is offline  
Old 08.02.2006, 14:24   #6
Kirikups
Архивный участник
 
Join Date: Oct 2005
Posts: 175
Default

yes you are right, i used i0 and it works great now, tx a lot fo your advices
Kirikups 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 17:52.