Curious Artila Insane Scythe Guy Posted July 5, 2005 Share Posted July 5, 2005 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. Link to comment Share on other sites More sharing options...
Hatchling Cockatrice Lilith Posted July 5, 2005 Share Posted July 5, 2005 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. Link to comment Share on other sites More sharing options...
Magnificent Ornk Drakefyre Posted July 5, 2005 Share Posted July 5, 2005 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. Link to comment Share on other sites More sharing options...
Curious Artila Insane Scythe Guy Posted July 5, 2005 Author Share Posted July 5, 2005 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? Link to comment Share on other sites More sharing options...
Magnificent Ornk Drakefyre Posted July 5, 2005 Share Posted July 5, 2005 My version of the docs calls it a void function. Link to comment Share on other sites More sharing options...
Magnificent Ornk Kelandon Posted July 5, 2005 Share Posted July 5, 2005 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. Link to comment Share on other sites More sharing options...
Magnificent Ornk Drakefyre Posted July 5, 2005 Share Posted July 5, 2005 Well, I have the beta version of the docs, so I wouldn't trust it if there's a conflict. Link to comment Share on other sites More sharing options...
Magnificent Ornk Kelandon Posted July 5, 2005 Share Posted July 5, 2005 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. Link to comment Share on other sites More sharing options...
Magnificent Ornk Drakefyre Posted July 5, 2005 Share Posted July 5, 2005 Not in a row, simultaneously Link to comment Share on other sites More sharing options...
Hatchling Cockatrice Lilith Posted July 5, 2005 Share Posted July 5, 2005 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... Link to comment Share on other sites More sharing options...
Recommended Posts