This is probably a very stupid question, but it's something that I just can't seem to figure out and is bothering me immensely.
Basically, the first thing you learn is that every action should have the structure "if... then begin... end" right? But the developers use the simplified "if... then" sometimes as well. So when can you use that and when not?
For instance, I tried the following at map_enter_p_proc somewhere:
and it seems to work just fine when I test it.
(By the way, I feel like an obnoxious idiot posting a new thread for each of my questions, but scripting stuff doesn't seem at home in the general mapper thread, so maybe this can be a general scripting questions thread from now on.)
Basically, the first thing you learn is that every action should have the structure "if... then begin... end" right? But the developers use the simplified "if... then" sometimes as well. So when can you use that and when not?
For instance, I tried the following at map_enter_p_proc somewhere:
Code:
if( cur_map_index == MAP_BH_RND_DESERT ) then
critter_add_trait(self_obj,TRAIT_OBJECT,OBJECT_TEAM_NUM,TEAM_PLAYER);
else
critter_add_trait(self_obj,TRAIT_OBJECT,OBJECT_TEAM_NUM,TEAM_DEN_SLAVER);
and it seems to work just fine when I test it.
(By the way, I feel like an obnoxious idiot posting a new thread for each of my questions, but scripting stuff doesn't seem at home in the general mapper thread, so maybe this can be a general scripting questions thread from now on.)