Jump to content

char_on_loc


Kiexcolo

Recommended Posts

I set a 1 square special encounter on location (13,3) with the script char_on_loc(13,3).

However it always returns a -1. So I tried debugging by changing it to char_on_loc(13,4) with the special encounter still placed on (13,3)and it returns the character standing on (13,4) the turn before I trigger the special encounter.

So how can I actually make it return the number of the character at(13,3)?

Link to comment
Share on other sites

Does this involve a PC stepping on the space? If so, there is perhaps an alternate way of doing this. This assumes the leading character will be the character to step on the space.

 

Code:
i = 0;while (i < 5) { if (char_ok(i)) {  lead_char = i;  i = 5; } else  i = i + 1;}  
Now, check the value of lead_char and that is the party member. Not as versatile, but gets the job done under appropriate conditions.

 

Nonetheless email spidweb@spiderwebsoftware.com to report this bug.

Link to comment
Share on other sites

Firstly, it is not a bug. Specials trigger before the character actually enters the square. That way they can, for instance, block the party from entering it.

 

The most efficient way to get what you want is first_group_member(0). Group 0 is the party.

Link to comment
Share on other sites

I didn't really test on this because I have moved on to something else but I think just using first_group_member(0) always returns 0 in which I might as well use 0. But if character 0 dies, then character 1 takes his spot in the game but remains character 1 so it will not return the correct character standing at that spot.

Its a bit messy but I think you know what I mean. *i's usage of char_ok(i) suits me better. Thanks anyway.

Link to comment
Share on other sites

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