 |
Castle Paradox
|
View previous topic :: View next topic |
Author |
Message |
XerotheYokai
Joined: 12 Dec 2004 Posts: 5
|
Posted: Sun Dec 12, 2004 3:46 pm Post subject: Changing characters |
|
|
Hi. I'm trying to take a character out of my party and put in another. It's not compiling, so I was wondering if anyone could help me? The script looks like this:
Define Script (1,Change,none)
script, My Script, begin
addhero (1)
swap in hero (1)
deletehero (0)
show text box (0)
end
This is the first time I've plotscripted, and I know there's probally multiple places where I could use some fine-tuning. If anyone could help me, I'd appreciate it. |
|
Back to top |
|
 |
Uncommon His legend will never die

Joined: 10 Mar 2003 Posts: 2503
|
Posted: Sun Dec 12, 2004 3:55 pm Post subject: |
|
|
Well, the reason it's not compiling is because you named the script "change", but when asked the script's name, put "my script".
Change "script, My Script, begin" to "script, Change, begin". That'll let it compile. We'll talk more from there. |
|
Back to top |
|
 |
XerotheYokai
Joined: 12 Dec 2004 Posts: 5
|
Posted: Sun Dec 12, 2004 6:51 pm Post subject: |
|
|
Thanks a lot. The script almost compiled! It got stuck at line 4, but here's the whole thing anyways:
Define Script (1,change,0)
script,change,begin
addhero (1)
swap in hero (1)
deletehero (0)
show text box (0)
end
I rea;;y appreciate ya'll for helping. |
|
Back to top |
|
 |
Setu_Firestorm Music Composer

Joined: 26 Mar 2003 Posts: 2566 Location: Holiday. FL
|
Posted: Mon Dec 13, 2004 6:13 am Post subject: |
|
|
Well, for starters, when you use "add hero", you don't need to use "swap in hero", because the hero is already in the party. I think what you're trying to do is pull out the starting hero to throw in another, so here's what you'd want to do:
Code: |
Define Script (1,change,0)
script,change,begin
addhero (1)
swap by position (0,1)
wait (1)
deletehero (0)
wait (1)
show text box (0)
end
|
Now, I just threw in the "wait (1)" commands for good measure; you don't necessarily have to use them in this script. "Swap by position" will swap heroes in the party according to where they stand. Since "Hero 0" is the leader and "Hero 1", after added to the party, is in the Party slot 1, they will be swapped so "Hero 1" will be leader. From there, you can "delete hero (0)".
One thing I think I should point out though: Are you sure you want to permanently kill off Hero 0? When you use "Delete Hero", it removes that hero from the party altogether, and if you re-added him, he'd start out at the base stats you gave him. If you just want him out of the party for a while, but keep his stats, I'd recommend you resort to this instead:
Code: |
Define Script (1,change,0)
script,change,begin
addhero (1)
swap by position (0,1)
wait (1)
swap out hero (0)
lock hero (0)
wait (1)
show text box (0)
end
|
Here, instead of deleting him, I swapped him out and locked him, so he will be in the Reserve party, but he'll stay there where the player can't pull him out until you specify later that you want him back in the party.
Hope that was some help to you. _________________
Facebook: http://www.facebook.com/georgerpowell
Newgrounds: http://setu-firestorm.newgrounds.com |
|
Back to top |
|
 |
Me HI.

Joined: 30 Mar 2003 Posts: 870 Location: MY CUSTOM TITLE CAME BACK
|
Posted: Mon Dec 13, 2004 11:47 am Post subject: |
|
|
You don't need the wait commands. Since the script isn't a loop, there's no chance of it recurring infinitely and overloading the buffer. |
|
Back to top |
|
 |
Moogle1 Scourge of the Seas Halloween 2006 Creativity Winner


Joined: 15 Jul 2004 Posts: 3377 Location: Seattle, WA
|
Posted: Mon Dec 13, 2004 11:50 am Post subject: |
|
|
And the heroswapping occurs instantly, if that's what you're looking out for. If it didn't, you should still use "wait(0)" instead to avoid the slight delay. _________________
|
|
Back to top |
|
 |
XerotheYokai
Joined: 12 Dec 2004 Posts: 5
|
Posted: Mon Dec 13, 2004 12:25 pm Post subject: |
|
|
Setu_Firestorm wrote: | Well, for starters, when you use "add hero", you don't need to use "swap in hero", because the hero is already in the party. I think what you're trying to do is pull out the starting hero to throw in another, so here's what you'd want to do:
Code: |
Define Script (1,change,0)
script,change,begin
addhero (1)
swap by position (0,1)
wait (1)
deletehero (0)
wait (1)
show text box (0)
end
|
Now, I just threw in the "wait (1)" commands for good measure; you don't necessarily have to use them in this script. "Swap by position" will swap heroes in the party according to where they stand. Since "Hero 0" is the leader and "Hero 1", after added to the party, is in the Party slot 1, they will be swapped so "Hero 1" will be leader. From there, you can "delete hero (0)".
One thing I think I should point out though: Are you sure you want to permanently kill off Hero 0? When you use "Delete Hero", it removes that hero from the party altogether, and if you re-added him, he'd start out at the base stats you gave him. If you just want him out of the party for a while, but keep his stats, I'd recommend you resort to this instead:
Code: |
Define Script (1,change,0)
script,change,begin
addhero (1)
swap by position (0,1)
wait (1)
swap out hero (0)
lock hero (0)
wait (1)
show text box (0)
end
|
Here, instead of deleting him, I swapped him out and locked him, so he will be in the Reserve party, but he'll stay there where the player can't pull him out until you specify later that you want him back in the party.
Hope that was some help to you. |
It was much help. I'd never though of using those commands, so I thank you. But hspeak is still having problems. I think its because I'm using the HamsterSpeak script editor. Anyways, it says it doesnt recognize the name Addhero. It has not been defined as a script, constant, variable, or anything else. This is basically the same problem I've been getting this whole time. |
|
Back to top |
|
 |
Moogle1 Scourge of the Seas Halloween 2006 Creativity Winner


Joined: 15 Jul 2004 Posts: 3377 Location: Seattle, WA
|
Posted: Mon Dec 13, 2004 1:14 pm Post subject: |
|
|
You need to "include plotscr.hsd" in your script. _________________
|
|
Back to top |
|
 |
XerotheYokai
Joined: 12 Dec 2004 Posts: 5
|
Posted: Mon Dec 13, 2004 3:13 pm Post subject: |
|
|
Thanks. That did it, and now my scro[ts can finally compile! thanks a lot! |
|
Back to top |
|
 |
Setu_Firestorm Music Composer

Joined: 26 Mar 2003 Posts: 2566 Location: Holiday. FL
|
|
Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|