View previous topic :: View next topic |
Author |
Message |
Dan the Man Entertainment
Joined: 31 May 2003 Posts: 204
|
Posted: Mon Jul 12, 2004 7:04 pm Post subject: swap in, swap out, keep party structure script |
|
|
The script itself is quite self explanatory (as is the subject of this post). What's not is why it won't work.
Code: |
script, allinswap, begin
if (place0==rank in caterpillar (0)) then
(
swap in hero (place1)
swap by position (rank in caterpillar (place1), 1)
swap in hero (place2)
swap by position (rank in caterpillar (place2), 2)
swap in hero (place3)
swap by position (rank in caterpillar (place3), 3)
)
if (place1==rank in caterpillar (0)) then
(
swap by position (1,0 )
swap in hero (place2)
swap by position (rank in caterpillar (place2), 0)
swap in hero (place2)
swap by position (rank in caterpillar (place2), 2)
swap in hero (place3)
swap by position (rank in caterpillar (place3), 3)
)
if (place2==rank in caterpillar (0)) then
(
swap by position (2,0 )
swap in hero (place0)
swap by position (rank in caterpillar (place0), 0)
swap in hero (place1)
swap by position (rank in caterpillar (place1), 1)
swap in hero (place3)
swap by position (rank in caterpillar (place3), 3)
)
if (place3==rank in caterpillar (0)) then
(
swap by position (3,0 )
swap in hero (place0)
swap by position (rank in caterpillar (place0), 0)
swap in hero (place1)
swap by position (rank in caterpillar (place1), 1)
swap in hero (place2)
swap by position (rank in caterpillar (place2), 2)
)
end
|
The script used to save the places in the variables is a simple:
set variable (place0, herobyslot (0))...and so on and so forth.
Answers? Shut up Dan? Anything? Post away :flamedevil: |
|
Back to top |
|
 |
Bob the Hamster OHRRPGCE Developer

Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
Posted: Mon Jul 12, 2004 9:22 pm Post subject: Re: swap in, swap out, keep party structure script |
|
|
The "swap by position" command uses the hero's position in the party, not the hero's rank in the caterpillar. You do not want any caterpillar commands when dealing with hero swapping. |
|
Back to top |
|
 |
Dan the Man Entertainment
Joined: 31 May 2003 Posts: 204
|
Posted: Mon Jul 12, 2004 9:25 pm Post subject: |
|
|
I thought that might be the problem (good thing I turned that into a command plotscript or I'd have hell). I'm gonna go try to fix it right now. If I have anymore problems, I'll edit this message.
Edit: Ok, I have no idea of what to do! Can you help me again spam man? |
|
Back to top |
|
 |
junahu Custom Title: 45 character limit

Joined: 13 Jan 2004 Posts: 369 Location: Hull, England
|
Posted: Wed Jul 14, 2004 3:58 am Post subject: |
|
|
This won't solve your problem but;
swap in hero (place2)
swap by position (rank in caterpillar (place2), 0)
swap in hero (place2)
swap by position (rank in caterpillar (place2), 2)
swap in hero (place3)
swap by position (rank in caterpillar (place3), 3)
shouldn't this be...
swap in hero (place0)
swap by position (rank in caterpillar (place0), 0)
swap in hero (place2)
swap by position (rank in caterpillar (place2), 2)
swap in hero (place3)
swap by position (rank in caterpillar (place3), 3) _________________
 |
|
Back to top |
|
 |
*Worthy* Critical Thinker

Joined: 11 Aug 2003 Posts: 186
|
Posted: Wed Jul 14, 2004 6:00 am Post subject: |
|
|
Uhh...maybe I'm just tired, but what is "place1"? I would think it refers to some position in the caterpillar (0 - 3), but when you say "swap in hero (place0)", I get confused.
And please, could you tell me what you are trying to do, such as: how "place0" and such were given a value, what you want to happen at the end, and anything else relevant to what you are trying to do?
Thanks,
~Worthy _________________ You can do whatever you want...but prison is full of people who make bad decisions. |
|
Back to top |
|
 |
*Worthy* Critical Thinker

Joined: 11 Aug 2003 Posts: 186
|
Posted: Wed Jul 14, 2004 7:38 am Post subject: |
|
|
Here is what I came up with...
Code: | script,saveall,begin
beefzokposition:=rank in caterpillar (1:beefzok)
pieraposition:=rank in caterpillar (2:piera)
hamfluxposition:=rank in caterpillar (3:hamflux)
porklanposition:=rank in caterpillar (4:porklan) #change the hero names so they are correct (with the number & spelling)
end
script,allinswap,begin
variable (i)
for (i,0,3,1) do #for statements are fun
(
if (beefzokposition==i) then
(
swap in hero (1:beefzok)
)
if (pieraposition==i) then
(
swap in hero (2:piera)
)
if (hamfluxposition==i) then
(
swap in hero (3:hamflux)
)
if (porklanposition==i) then
(
swap in hero (4:porklan)
)
)
end |
Change all the hero names & numbers (e.g. 3:hamflux) to whatever they are in your game file or it won't work.
Hope this helps,
~Worthy _________________ You can do whatever you want...but prison is full of people who make bad decisions. |
|
Back to top |
|
 |
Dan the Man Entertainment
Joined: 31 May 2003 Posts: 204
|
Posted: Wed Jul 14, 2004 12:19 pm Post subject: |
|
|
Nope, didn't work.
But I think you're on to something Worthy.
I might be able to fix this now.
Again, thanks for the help Worthy. |
|
Back to top |
|
 |
*Worthy* Critical Thinker

Joined: 11 Aug 2003 Posts: 186
|
Posted: Wed Jul 14, 2004 12:56 pm Post subject: |
|
|
Alright. If you can't fix it, let me know specifically what happens when you used the script I recommended, and I should be able to help you.
~Worthy _________________ You can do whatever you want...but prison is full of people who make bad decisions. |
|
Back to top |
|
 |
Dan the Man Entertainment
Joined: 31 May 2003 Posts: 204
|
Posted: Wed Jul 14, 2004 1:23 pm Post subject: |
|
|
It turns out I forgot to edit the numbers before the names. The script doesn't FULLY work, but it works in the script that Hamflux is added. |
|
Back to top |
|
 |
*Worthy* Critical Thinker

Joined: 11 Aug 2003 Posts: 186
|
Posted: Wed Jul 14, 2004 2:30 pm Post subject: |
|
|
Ugh...sorry, I forgot that you will already have a hero occupying the 0 slot. You going to have to take that hero out prior to swapping in the hero going to the 0 slot.
~Worthy _________________ You can do whatever you want...but prison is full of people who make bad decisions. |
|
Back to top |
|
 |
Dan the Man Entertainment
Joined: 31 May 2003 Posts: 204
|
Posted: Thu Jul 15, 2004 10:27 am Post subject: |
|
|
Ok Worthy, your script works perfectly ( I think. If I find any problems, I'll say). Now all I need to figure out is how to swap two people in a party if the person who's not the leader needs to be the leader. |
|
Back to top |
|
 |
Dan the Man Entertainment
Joined: 31 May 2003 Posts: 204
|
Posted: Fri Jul 16, 2004 9:43 am Post subject: |
|
|
The problems are solved. I used a script to switch the leader and the person getting the class change (since this is a non-caterpillar game).
Thank's for all the help Worthy. |
|
Back to top |
|
 |
|