Castle Paradox Forum Index Castle Paradox

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Gamelist   Review List   Song List   All Journals   Site Stats   Search Gamelist   IRC Chat Room

swap in, swap out, keep party structure script

 
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP!
View previous topic :: View next topic  
Author Message
Dan the Man Entertainment




Joined: 31 May 2003
Posts: 204

PostPosted: Mon Jul 12, 2004 7:04 pm    Post subject: swap in, swap out, keep party structure script Reply with quote

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
View user's profile Send private message
Bob the Hamster
OHRRPGCE Developer




Joined: 22 Feb 2003
Posts: 2526
Location: Hamster Republic (Southern California Enclave)

PostPosted: Mon Jul 12, 2004 9:22 pm    Post subject: Re: swap in, swap out, keep party structure script Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Dan the Man Entertainment




Joined: 31 May 2003
Posts: 204

PostPosted: Mon Jul 12, 2004 9:25 pm    Post subject: Reply with quote

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
View user's profile Send private message
junahu
Custom Title: 45 character limit




Joined: 13 Jan 2004
Posts: 369
Location: Hull, England

PostPosted: Wed Jul 14, 2004 3:58 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
*Worthy*
Critical Thinker




Joined: 11 Aug 2003
Posts: 186

PostPosted: Wed Jul 14, 2004 6:00 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail AIM Address
*Worthy*
Critical Thinker




Joined: 11 Aug 2003
Posts: 186

PostPosted: Wed Jul 14, 2004 7:38 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail AIM Address
Dan the Man Entertainment




Joined: 31 May 2003
Posts: 204

PostPosted: Wed Jul 14, 2004 12:19 pm    Post subject: Reply with quote

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
View user's profile Send private message
*Worthy*
Critical Thinker




Joined: 11 Aug 2003
Posts: 186

PostPosted: Wed Jul 14, 2004 12:56 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail AIM Address
Dan the Man Entertainment




Joined: 31 May 2003
Posts: 204

PostPosted: Wed Jul 14, 2004 1:23 pm    Post subject: Reply with quote

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
View user's profile Send private message
*Worthy*
Critical Thinker




Joined: 11 Aug 2003
Posts: 186

PostPosted: Wed Jul 14, 2004 2:30 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail AIM Address
Dan the Man Entertainment




Joined: 31 May 2003
Posts: 204

PostPosted: Thu Jul 15, 2004 10:27 am    Post subject: Reply with quote

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
View user's profile Send private message
Dan the Man Entertainment




Joined: 31 May 2003
Posts: 204

PostPosted: Fri Jul 16, 2004 9:43 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP! All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
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