get_nearest_char
Author | Topic: get_nearest_char |
---|---|
The Establishment
Member # 6
|
written Thursday, July 15 2004 14:52
Profile
It seems when the get_nearest_char commands are called in a creature script, it returns its own number for its value. The creature running the script was created using the place_monster call. Is anyone else having problems with this? -------------------- Your flower power is no match for my glower power! Posts: 3726 | Registered: Tuesday, September 18 2001 07:00 |
Agent
Member # 2820
|
written Tuesday, July 20 2004 07:36
Profile
You're right! get_nearest_char() and get_nearest_good_char() always return the creature for which the script is running. I think those were mainly for use with terrain scripts, though. But that is unfortunate because then this would be the only good alternative: -------------------- Thuryl: I mean, most of us don't go around consuming our own bodily fluids, no matter how delicious they are. ==== Alorael: War and violence would end if we all had each other's babies! ==== Drakefyre: Those are hideous mangos. Posts: 1415 | Registered: Thursday, March 27 2003 08:00 |
Post Navel Trauma ^_^
Member # 67
|
written Tuesday, July 20 2004 09:59
Profile
Homepage
I assume you mean closest = dist_to_char(i), not closest = i -------------------- Barcoorah: I even did it to a big dorset ram. New Mac BoE Posts: 1798 | Registered: Thursday, October 4 2001 07:00 |
Off With Their Heads
Member # 4045
|
written Tuesday, July 20 2004 10:11
Profile
Homepage
No, because the idea is to get the nearest character number, not the distance to the nearest character. -------------------- Arancaytar: Every time you ask people to compare TM and Kel, you endanger the poor, fluffy kittens. Smoo: Get ready to face the walls! Ephesos: In conclusion, yarr. Kelandon's Pink and Pretty Page!!: the authorized location for all things by me The Archive of all released BoE scenarios ever Posts: 7968 | Registered: Saturday, February 28 2004 08:00 |
Shock Trooper
Member # 4154
|
written Tuesday, July 20 2004 19:49
Profile
Creature scripts perplex me beyond belief... And if I'm not baffled more than I think I am, I'll allow myself to point out that 'while' doesn't seem necessary there. Wouldn't an 'if' work the same? Or am I just creature-script-inept? -------------------- You're a moron if you think I'm not. Posts: 213 | Registered: Friday, March 26 2004 08:00 |
Off With Their Heads
Member # 4045
|
written Tuesday, July 20 2004 19:54
Profile
Homepage
The idea of the "while" is to check the distance of every single possible living monster and keep track of which one is the lowest. An "if" wouldn't really do that. Although, looking at it again, I realize that the "i = i + 1" part is misplaced. It should be inside the "while," or else the thing will loop infinitely. -------------------- Arancaytar: Every time you ask people to compare TM and Kel, you endanger the poor, fluffy kittens. Smoo: Get ready to face the walls! Ephesos: In conclusion, yarr. Kelandon's Pink and Pretty Page!!: the authorized location for all things by me The Archive of all released BoE scenarios ever Posts: 7968 | Registered: Saturday, February 28 2004 08:00 |
Shock Trooper
Member # 4154
|
written Tuesday, July 20 2004 20:35
Profile
Ahhh, that makes more sense then. I still don't get what's going on, but it makes more sense. -------------------- You're a moron if you think I'm not. Posts: 213 | Registered: Friday, March 26 2004 08:00 |
Agent
Member # 2820
|
written Wednesday, July 21 2004 09:09
Profile
Oh yes, there are many problems with my code. -------------------- Thuryl: I mean, most of us don't go around consuming our own bodily fluids, no matter how delicious they are. ==== Alorael: War and violence would end if we all had each other's babies! ==== Drakefyre: Those are hideous mangos. Posts: 1415 | Registered: Thursday, March 27 2003 08:00 |