Adding a new hero to the party doesn't work
Moderators: marionline, SDHawk
- Seamus Moore
- Slime
- Posts: 19
- Joined: Mon Mar 16, 2020 9:39 pm
- Location: Seamus Moore's House
Adding a new hero to the party doesn't work
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
- Seamus Moore
- Slime
- Posts: 19
- Joined: Mon Mar 16, 2020 9:39 pm
- Location: Seamus Moore's House
- Bob the Hamster
- Lord of the Slimes
- Posts: 7684
- Joined: Tue Oct 16, 2007 2:34 pm
- Location: Hamster Republic (Ontario Enclave)
- Contact:
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
- Seamus Moore
- Slime
- Posts: 19
- Joined: Mon Mar 16, 2020 9:39 pm
- Location: Seamus Moore's House
- Bob the Hamster
- Lord of the Slimes
- Posts: 7684
- Joined: Tue Oct 16, 2007 2:34 pm
- Location: Hamster Republic (Ontario Enclave)
- Contact:
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"?
- Attachments
-
- DDD0000.png (3.17 KiB) Viewed 6278 times
- Seamus Moore
- Slime
- Posts: 19
- Joined: Mon Mar 16, 2020 9:39 pm
- Location: Seamus Moore's House
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?
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 , 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.
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: Select all
add hero (5)
swap by position (find hero (5),2)
Code: Select all
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.
Last edited by Bird on Tue Feb 16, 2021 5:51 am, edited 1 time in total.
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.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.
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
There no need to export the .hsi file or worry about that, as it's exported automatically when compiling.Bird wrote:If you want to use your hero by name, like, there has to be an entry in the .hsi file, that can be exported in the scripts menu.Code: Select all
find hero (hero:James)