 |
Castle Paradox
|
View previous topic :: View next topic |
Author |
Message |
Uncommon His legend will never die

Joined: 10 Mar 2003 Posts: 2503
|
Posted: Wed Mar 31, 2004 8:03 pm Post subject: Two quick questions. |
|
|
1. The plotscript dictionary says that "create npc" returns a new npc reference. How would I best be able to take advantage of this SPECIFIC reference, aside from looking for it through trial and error?
2. I'm looking for a command that remotely controls the party position. Like, I can use it to move party members into SPECIFIC spots (if you noticed, I'm kind of big on specifics; well, not really me, but the scripts are). None of the existing "swap hero" commands appear to be what I'm looking for. Is there such a command?
Thank you for your time, and hopefully your answers. |
|
Back to top |
|
 |
Camdog
Joined: 08 Aug 2003 Posts: 606
|
Posted: Thu Apr 01, 2004 1:11 am Post subject: |
|
|
1. Since create NPC is a function just like any user defined function, the reference will be returned from it, so you should be able to stick it directly into a variable like so...
myReference := create NPC(id,x,y,direction)
The reference will be in myReference, ready for you to use at your leisure.
2. You should be able to do this by checking who is in the position you want to move the party member to, and then swapping them.
Code: |
script, swap to spot, position, theHero, begin
#find the name of the hero that exists in the location you want to swap to
swapHero := hero by slot(position)
#swap that hero with the hero you want to move
swap by name(swapHero, theHero)
end
|
Swap by name should work fine in this situation since, even though we're dealing with numbers, the constants that refer to hero names are just (I think) translated to numbers by hspeak's preprocessor anyway.
I'm pretty sure both of these solutions will work, but I haven't sat down and tried them out yet. |
|
Back to top |
|
 |
Uncommon His legend will never die

Joined: 10 Mar 2003 Posts: 2503
|
Posted: Thu Apr 01, 2004 8:02 pm Post subject: |
|
|
Well, I've tried that with create npc before, and it was a little wonky. I'll try it again, though. Maybe it'll work on this different script...
Oh, and, yes, I have tried just using "npc at spot" instead. It just got wonkier.
Thanks for the swapping tip, though. |
|
Back to top |
|
 |
Camdog
Joined: 08 Aug 2003 Posts: 606
|
Posted: Thu Apr 01, 2004 11:18 pm Post subject: |
|
|
What exactly was wonky about it? Maybe it was something else in the script? It might be helpful if you posted your code. |
|
Back to top |
|
 |
Uncommon His legend will never die

Joined: 10 Mar 2003 Posts: 2503
|
Posted: Fri Apr 02, 2004 2:56 pm Post subject: |
|
|
Well, I already tried what you suggested with the variables, and it works fine. I'm not exactly sure why it qwas wonky, and I no longer have the wonky code anyway, so, yeah... |
|
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
|