move_to_loc_x_y question

Error message

Deprecated function: implode(): Passing glue string after array is deprecated. Swap the parameters in drupal_get_feeds() (line 394 of /var/www/pied-piper.ermarian.net/includes/common.inc).
AuthorTopic: move_to_loc_x_y question
Apprentice
Member # 5914
Profile #0
In my creature script (haven't got it handy at the moment, though) I have the creature summon a specific monster on one of nearby spots nearby under the following conditions:
the spot is visible (easy to get)
some health vs max health or energy (easy to get)
the spot is unoccupied (also easy to get)
the spot is reachable - i.e. if its height is greater/lesser than where the summoner is then the script is to make sure that there is a way for the summoned one to climb it up); also to check if the terrain in there allows creatures to go on that space (hopefully the call works that way).

For the last condition I use the call
if (move_to_loc_x_y(co-ordinates go here) == FALSE)
so that the summoner is not going there and the path is not blocked.
Then, and only the may the summoned guy be, well, summoned.
But will this call work? Theoretically, of course.
Posts: 13 | Registered: Tuesday, June 7 2005 07:00
...b10010b...
Member # 869
Profile Homepage #1
Sorry, but it doesn't work that way. move_to_loc_x_y doesn't return a value, so you can't use it in a conditional statement. There isn't really an easy way to do what you want. In fact, even BoA's ordinary summoning spells don't always get it right; they can sometimes summon creatures on top of unreachable ledges.

--------------------
The Empire Always Loses: This Time For Sure!
Posts: 9973 | Registered: Saturday, March 30 2002 08:00
Triad Mage
Member # 7
Profile Homepage #2
No, the call move_to_loc_x_y doesn't return any value, and I'm not sure that it would create the desired effect anyway even if it did.

EDIT: You may want to use the call approach_waypoint

EDIT 2: Thuryl posted as I was ... at least we said the same thing.

You may want to pick several spaces for the summoned monster to go (memory cells?) and place runes there or something. Then you can randomly place s/he on one spot. Another answer is just to not have any unreachable ledges around the summoner.

[ Tuesday, July 05, 2005 05:27: Message edited by: Drakefyre ]

--------------------
"At times discretion should be thrown aside, and with the foolish we should play the fool." - Menander
====
Drakefyre's Demesne - Happy Happy Joy Joy
Encyclopedia Ermariana - Trapped in the Closet
====
You can take my Mac when you pry my cold, dead fingers off the mouse!
Posts: 9436 | Registered: Wednesday, September 19 2001 07:00
Apprentice
Member # 5914
Profile #3
From Wikipedia Reference Guide:

short move_to_loc_x_y(short which_char_or_group,short x,short y)

Has the character move as close a possible to location {x,y}. If the character is already moving, the old destination is forgotten. Returns 1 if the character doesn’t move (because it is close already or can’t find a path there), 0 otherwise.

Does this no longer apply?
Posts: 13 | Registered: Tuesday, June 7 2005 07:00
Triad Mage
Member # 7
Profile Homepage #4
My version of the docs calls it a void function.

--------------------
"At times discretion should be thrown aside, and with the foolish we should play the fool." - Menander
====
Drakefyre's Demesne - Happy Happy Joy Joy
Encyclopedia Ermariana - Trapped in the Closet
====
You can take my Mac when you pry my cold, dead fingers off the mouse!
Posts: 9436 | Registered: Wednesday, September 19 2001 07:00
Off With Their Heads
Member # 4045
Profile Homepage #5
It appears (based on the old bugs page) that move_to_loc_x_y didn't used to work but was fixed for a more recent version. It seems likely that it was changed from a short to a void in that time in order to make it functional.

The easy way to test it, obviously, is to make a creature script with print_num(move_to_loc_x_y(my_number(),some_x,some_y)) in the START_STATE.

--------------------
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
Triad Mage
Member # 7
Profile Homepage #6
Well, I have the beta version of the docs, so I wouldn't trust it if there's a conflict. :P

--------------------
"At times discretion should be thrown aside, and with the foolish we should play the fool." - Menander
====
Drakefyre's Demesne - Happy Happy Joy Joy
Encyclopedia Ermariana - Trapped in the Closet
====
You can take my Mac when you pry my cold, dead fingers off the mouse!
Posts: 9436 | Registered: Wednesday, September 19 2001 07:00
Off With Their Heads
Member # 4045
Profile Homepage #7
Hmm. My docs call it a short. Time to do that test, then.

EDIT: Yes, move_to_loc_x_y is very definitely a short. I have it returning a number. That's got to be the first time I've ever seen two oldbies in a row be wrong.

[ Tuesday, July 05, 2005 08:03: Message edited by: Manhood Typing Kelandon ]

--------------------
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
Triad Mage
Member # 7
Profile Homepage #8
Not in a row, simultaneously :P

--------------------
"At times discretion should be thrown aside, and with the foolish we should play the fool." - Menander
====
Drakefyre's Demesne - Happy Happy Joy Joy
Encyclopedia Ermariana - Trapped in the Closet
====
You can take my Mac when you pry my cold, dead fingers off the mouse!
Posts: 9436 | Registered: Wednesday, September 19 2001 07:00
...b10010b...
Member # 869
Profile Homepage #9
My docs called it a void too. When the docs are wrong (or at least outdated), it's not really our fault when we rely on them... :P

--------------------
The Empire Always Loses: This Time For Sure!
Posts: 9973 | Registered: Saturday, March 30 2002 08:00