Jump to content

Help with a monster script...?


Eldiran

Recommended Posts

Yes, I suck at monster scripts. I'm experimenting with one that causes the monster to explode when hit, but I've run into an error I can't decipher.

 

The problematic part of the script:

 

beginstate START_STATE;

// Have I been hit? Kamikazeeeeee!

~ ~ if (who_hit_me() >= 0) {

~ ~ ~ if (get_memory_cell(4) > 0)

~ ~ ~ ~ h = (get_memory_cell(4));

~ ~ ~ else

~ ~ ~ ~ h = get_health(s);

~ ~ ~ x = my_loc_x();

~ ~ ~ y = my_loc_y();

~ ~ ~ play_sound(-12);

~ ~ ~ put_effect_on_space(x,y,9,0);

~ ~ ~ play_sound(-5);

~ ~ ~ put_boom_on_space(x,y,1,0);

~ ~ ~ damage_nearby(h,2,1,2);

~ ~ ~ kill_char(s,2,0);

~ ~ ~ break; }

 

I know this is the area where there's a problem, because it's all I added to basicnpc. So anyway. Blades of Avernum gives me an error saying wrong number/type in line 48, or something to that effect. Earlier an error said there was no semicolon in line 48, which was true, and I fixed that. Line 48 is "play_sound(-12);"

 

I'm assuming the error message is off somehow, but I still don't know what's wrong with my script.

 

Variable s is assigned to be the number of the creature running the script.

 

Mem. cell 4 is how much damage is dealt nearby. If this is zero, then variable h (which is normally assigned as mem. cell 4) becomes the remaining health of the monster.

 

Any ideas?

 

EDIT: Grr... since spaces and tab doesn't work, I'll use tildas to make it more readable.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...