The active party has only two heroes in it, I want to add a third completely new hero, but when I do with a simple add hero command, A script error pops up, and says that I tried to add it to the party position -38. which doesn't make sense. help.
dQw4w9WgXcQ
Yeah, Seamus, you are doing it correctly, this has to be a bug.
Can you e-mail a copy of the rpg file to bob@hamsterrepublic.com ? You could also send an rsav file right before the hero is added
Can you e-mail a copy of the rpg file to bob@hamsterrepublic.com ? You could also send an rsav file right before the hero is added
I was able to reproduce the error message, but it is coming from "pathfindheroto" not from "add hero"
If I pick "ignore" on the error message, I can see that the add hero command succeeded, and the new hero is in the party.
So the error is coming from a different part of the script. Can you show us the part of the script where you use "pathfind hero to"?
If I pick "ignore" on the error message, I can see that the add hero command succeeded, and the new hero is in the party.
So the error is coming from a different part of the script. Can you show us the part of the script where you use "pathfind hero to"?
Thanks for the help.
Now that I look at it, i see that the error message was caused by me writing "pathfind hero to" instead of "pathfind npc to".
But, I still have an issue, I want the new hero to take up the third slot in the active party instead of replacing the hero in the second slot. But I cant get It to work. How would I do that?
dQw4w9WgXcQ
Now that I look at it, i see that the error message was caused by me writing "pathfind hero to" instead of "pathfind npc to".
But, I still have an issue, I want the new hero to take up the third slot in the active party instead of replacing the hero in the second slot. But I cant get It to work. How would I do that?
dQw4w9WgXcQ
I think you need the command "swap by position".
This will swap hero #5 with the one in position 2 (meaning third position, as counting starts at 0). If you want to use your hero by name, like
If the hero positions in the party should stay fixed in your game, you probably should use "lock hero (5)" so that there can't be any reordering.
Code:
add hero (5)
swap by position (find hero (5),2)
swap by position (find hero (5),2)
This will swap hero #5 with the one in position 2 (meaning third position, as counting starts at 0). If you want to use your hero by name, like
Code:
, there has to be an entry in the .hsi file, that can be exported in the scripts menu. It translates the name to a constant, that the script would normally use.
find hero (hero:James)
If the hero positions in the party should stay fixed in your game, you probably should use "lock hero (5)" so that there can't be any reordering.
Seamus Moore wrote:
I want the new hero to take up the third slot in the active party instead of replacing the hero in the second slot.
What Bird wrote is correct... but the question you asked doesn't seem to make sense. "add hero" always puts the new hero into an empty party slot, it doesn't move existing heroes.
I think your question indicates that when you add the hero it appears in the 2nd caterpillar slot, bumping the hero that was in the 2nd to 3rd, because there was an empty party slot in front of the existing hero that the new one got added into. E.g.
slot 0: John
slot 1: (empty) <- "add hero(hero:Joan)" goes here
slot 2: Jim
slot 3: (empty)
If so, what Bird wrote would fix it, unless your party looks like
slot 0: John
slot 1: (empty) <- "add hero(hero:Joan)" goes here
slot 2: (empty) <- and then "swap by position" puts Joan here
slot 3: Jim
Bird wrote:
If you want to use your hero by name, like
Code:
, there has to be an entry in the .hsi file, that can be exported in the scripts menu.find hero (hero:James)
There no need to export the .hsi file or worry about that, as it's exported automatically when compiling.