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

Something strange in the script
Goto page Previous  1, 2, 3, 4  Next
 
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP!
View previous topic :: View next topic  
Author Message
Mike Caron
Technomancer




Joined: 26 Jul 2003
Posts: 889
Location: Why do you keep asking?

PostPosted: Fri May 12, 2006 3:50 pm    Post subject: Reply with quote

Also, the 63-65 in the codes are the numbers of global variables. Change them to numbers of free globals in your scripts (or, leave them as they are, doesn't really matter)
_________________
I stand corrected. No rivers ran blood today. At least, none that were caused by us.

Final Fantasy Q
OHR Developer BLOG
Official OHRRPGCE Wiki and FAQ
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
bis_senchi




Joined: 08 Jun 2004
Posts: 460
Location: Reims, France

PostPosted: Thu May 18, 2006 8:41 pm    Post subject: Sorry but... Reply with quote

Sorry but when I use the following scripts the text box appears with 0 in it but then I can't make them disappear. Furthermore, I can't deposit any money whereas three 0 appears and I've replaced ( and) by {and}

Anyone has any idea why the script wouldn't work??
Thanks for the help!

Code:


define script (14, bank script, none)
define script (autonumber, withdraw, 1, 0)
define script (autonumber, deposit, 1, 0)

    Global variable (0,bankbalance)# Banque
    Global variable (1, goldvar)   # Banque2
    Global variable (2, bankvar)   # Banque3


#---------------------------------------------------------------------------
script, deposit, amount, begin
 if (pay money (amount)) then, begin
  bankbalance := bankbalance + amount
 end
end
#---------------------------------------------------------------------------
script, withdraw, amount, begin
 if (bankbalance >= amount) then, begin
  bankbalance := bankbalance -- amount
  get money (amount)
 end
end
#---------------------------------------------------------------------------
script, bank script, begin

 variable (whichbox)   #which text box to show
 variable (pressedkey) #simplify keystroke interpretation a bit
 variable (i)          #loop counter

 #get current amount of money
 #unfortunately this takes a long time if you have a lot of money
 #stops counting at 32767
 goldvar := 0
 while (goldvar<= 32767,and,pay money(1)) do(goldvar += 1)
 get money (goldvar)

 bankvar := 0 #default deposit/withdrawal amount is zero

 show text box (29)     #ask the player what he wants to do
 wait for text box     #wait for the player to make a choice

 if (check tag(tag:Withdraw)) then (whichbox := WithdrawBox)
  else (whichbox := DepositBox)
 #figure out which text box to use for all this

 #now, loop until we get the amount to withdraw/deposit.
 set tag(tag:BankInputNotDone, true)
 suspend box advance
 show text box (whichbox)
 while (check tag(tag:BankInputNotDone)) do, begin
  wait(1) #might need to mess with this value to avoid hypersensitivity
  #find out what key was pressed, if any
  #first, if the key was Enter, input is done
  if (key is pressed(key:ENTER)) then (set tag(tag:BankInputNotDone, false)) else, begin

   #next, if Backspace is pressed, erase the last digit
   if (key is pressed(key:BACKSPACE)) then, begin
    bankvar := bankvar/10
    advance text box         #clear the current text box...
    show text box (whichbox) #...and redisplay it, updated
   end

   #finally, otherwise, check for digits
   else, begin
    pressedkey := 0           #initially assume no key pressed
    for (i, 2, 11, 1) do (if (key is pressed(i)) then (pressedkey := i))  #top-row numbers
    for (i, 71, 82, 1) do (if (key is pressed(i)) then (pressedkey := i)) #numpad numbers

    if (pressedkey <> 0) then, begin
     #change value of bankvar appropriately
     bankvar := bankvar*10
     if ((pressedkey == key:1),or,(pressedkey == key:NUMPAD 1)) then (bankvar +=1)
     if ((pressedkey == key:2),or,(pressedkey == key:NUMPAD 2)) then (bankvar +=2)
     if ((pressedkey == key:3),or,(pressedkey == key:NUMPAD 3)) then (bankvar +=3)
     if ((pressedkey == key:4),or,(pressedkey == key:NUMPAD 4)) then (bankvar +=4)
     if ((pressedkey == key:5),or,(pressedkey == key:NUMPAD 5)) then (bankvar +=5)
     if ((pressedkey == key:6),or,(pressedkey == key:NUMPAD 6)) then (bankvar +=6)
     if ((pressedkey == key:7),or,(pressedkey == key:NUMPAD 7)) then (bankvar +=7)
     if ((pressedkey == key:8),or,(pressedkey == key:NUMPAD 8)) then (bankvar +=8)
     if ((pressedkey == key:9),or,(pressedkey == key:NUMPAD 9)) then (bankvar +=9)
     if (bankvar<<0) then (bankvar:=32767) #check for overflow
     advance text box         #clear the current text box...
     show text box (whichbox) #...and redisplay it, updated
    end
   end
  end
 end
 
 resume box advance
 if (check tag(tag:Withdraw)) then (withdraw(bankvar)) else (deposit(bankvar))
end
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Moogle1
Scourge of the Seas
Halloween 2006 Creativity Winner
Halloween 2006 Creativity Winner



Joined: 15 Jul 2004
Posts: 3377
Location: Seattle, WA

PostPosted: Thu May 18, 2006 10:11 pm    Post subject: Reply with quote

Does text box 29 even show up? Do WithdrawBox and DepositBox say anything besides the number?
_________________
Back to top
View user's profile Send private message Visit poster's website AIM Address
Ysoft_Entertainment
VB Programmer




Joined: 23 Sep 2003
Posts: 810
Location: Wherever There is a good game.

PostPosted: Thu May 18, 2006 10:50 pm    Post subject: Reply with quote

From a quick scan, I can see that your first while loop doesn't have a wait command, this freezes the game.

next, does your textbox have something like this ${v##} where ## is number of the global variable that shows the bank balance or whatever number you want to display.
_________________
Try my OHR exporter/importer.
OHRGFX
Striving to become better pixel artist then Fenrir Lunaris. Unfortunately the laziness gets in the way of my goals.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Mike Caron
Technomancer




Joined: 26 Jul 2003
Posts: 889
Location: Why do you keep asking?

PostPosted: Fri May 19, 2006 2:17 pm    Post subject: Reply with quote

It doesn't need a wait, it just counts the player's money.

Are WithdrawBox and DepositBox constants? If so, what are they, and what are their textboxes?
_________________
I stand corrected. No rivers ran blood today. At least, none that were caused by us.

Final Fantasy Q
OHR Developer BLOG
Official OHRRPGCE Wiki and FAQ
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
bis_senchi




Joined: 08 Jun 2004
Posts: 460
Location: Reims, France

PostPosted: Fri May 19, 2006 10:14 pm    Post subject: I've made some tests and... Reply with quote

I've change the global variable definitions

Code:

    Global variable (63,bankbalance)# Banque
    Global variable (64, goldvar)   # Banque2
    Global variable (65, bankvar)   # Banque3


I can know see the amount of money I hold. Anyway, as Mike explained the while doesn't need a wait command because it just counts money.

Text box 29 roughly say "hello sir welcome to the bank what do you want to do? Withdraw / Deposit. I've included it here as explained in the article in the wiki.

My problems are the following

1) for strange reasons when I speak to the bank officier he sometimes display text box 29 and some other times he display the text box with the amount of money you have.
2) each time I make run the script the text box with the deposit or withdraw amount stays on screen. It was as if the advance text box and resume box advance commands has just no effects.

Thanks once more for help and advice.
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Gizmog1
Don't Lurk In The Bushes!




Joined: 05 Mar 2003
Posts: 2257
Location: Lurking In The Bushes!

PostPosted: Fri May 19, 2006 10:18 pm    Post subject: Reply with quote

You might need a wait command. The "ShowTextBox" command specifies that the textbox won't be shown until the next wait command. A simple "wait (2) or so should suffice.
Back to top
View user's profile Send private message Send e-mail AIM Address
bis_senchi




Joined: 08 Jun 2004
Posts: 460
Location: Reims, France

PostPosted: Sat May 20, 2006 9:40 pm    Post subject: Well... Reply with quote

Let's try a wait (2) command but where shall I put it in the script?

I didn't know that the wait command could act as wait for text when text box advance is suspended...
Anyway there's still something new to learn in plotscripting!
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
msw188




Joined: 02 Jul 2003
Posts: 1041

PostPosted: Mon May 22, 2006 1:30 pm    Post subject: Reply with quote

Not quite helpful for the Bis Senchi's problem, but I think that I had a much more efficient method for calculating how much money a player has. I don't want to mess it up now, but when I go home I'll pull it out and copy it to post on here, if anyone is interested (it counted down starting with large numbers, rather than counting down 1 at a time, as the current method seems to do).
Back to top
View user's profile Send private message Visit poster's website
bis_senchi




Joined: 08 Jun 2004
Posts: 460
Location: Reims, France

PostPosted: Thu May 25, 2006 9:16 pm    Post subject: Let's solve another problem! Reply with quote

Ok let's put apart the bank script for some times. Here's another problem.

I would like to modify the gradual fade out (see above) so that at the end I tweak the palette (-48, -48 , 0).

Code:

   # gradual fade out
   for(loop,0,-21,-1) do(   
   reset palette
   tweak palette(loop*2,loop*2,loop*2)
   update palette
   wait(2)
   ) 


So has someone has any idea on how to do it?
As always thanks very much for the help!
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Mike Caron
Technomancer




Joined: 26 Jul 2003
Posts: 889
Location: Why do you keep asking?

PostPosted: Sat May 27, 2006 11:36 am    Post subject: Reply with quote

That's easy:

Code:
for(loop,0,23,1) do, begin
  tweak palette(-2,-2,0)
  update palette
  wait(2)
end


tweak palette "shifts" the palette values by the amount you specify. So, if you shift Red and Green by -2, 24 times, the net result is -48 (-2 * 24 = -4Cool
_________________
I stand corrected. No rivers ran blood today. At least, none that were caused by us.

Final Fantasy Q
OHR Developer BLOG
Official OHRRPGCE Wiki and FAQ
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
bis_senchi




Joined: 08 Jun 2004
Posts: 460
Location: Reims, France

PostPosted: Mon May 29, 2006 9:05 pm    Post subject: Thanks a lot! Reply with quote

Thanks a lot Mike Caron!

I am working on my YuGiOh! battle system and I would to create a life count system. I am using a map as a Duel Arena.
The figures would appear on the left corner of the screen.
Does somoene has any idea on how to appear on screen figures that can be changes? (I mean by this any idea on the command that I could use?)

Several suggestions are welcomed.

Thanks in advance for the help as always!
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Ysoft_Entertainment
VB Programmer




Joined: 23 Sep 2003
Posts: 810
Location: Wherever There is a good game.

PostPosted: Tue May 30, 2006 6:32 am    Post subject: Reply with quote

Alternpc would change the characters on the screen, if thats what you mean. If you want a none animated characters, you could use maptiles. thats what I used in 2 of my games(final fantasy memory card game, and final fantasy memory card game DX. Also used same thing in not-yet-released blackjack ohr)
_________________
Try my OHR exporter/importer.
OHRGFX
Striving to become better pixel artist then Fenrir Lunaris. Unfortunately the laziness gets in the way of my goals.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
bis_senchi




Joined: 08 Jun 2004
Posts: 460
Location: Reims, France

PostPosted: Tue May 30, 2006 10:12 pm    Post subject: Alter Npc seems to be a good idea. Reply with quote

Well well ... alter npc definitely seems to be what I need.
You have said that

Quote:
if you want a none animated characters, you could use maptiles


Could you explain how to animate characters using maptitle?
By the way does the word "character" refers to heroes or npcs?

Thanks for answering so quickly!
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Mike Caron
Technomancer




Joined: 26 Jul 2003
Posts: 889
Location: Why do you keep asking?

PostPosted: Wed May 31, 2006 4:26 pm    Post subject: Reply with quote

What YSoft meant to say was this:

If you need to display an HP count or something, you can use a string instead of NPCs. Or, if it uses a 'token' system (the only TCG I'm familiar with is Pokémon), you could use a 'letter' to represent the token (more likely a special font character), and just display it repeatedly, like a heart meter.

For doing cards, this depends how much detail you want to put into them. By this, I mean:

~ Picture?
~ List of moves/effects?
~ Descriptions of said moves and effects?
~ Vital stats?
~ Irrelavent "extra info" line at the bottom?

You could use tiles to "draw" the cards, and use NPCs and strings to actually display stuff on the cards. The way you would do this depends on how big you want the cards to be, although I can help you with more details.
_________________
I stand corrected. No rivers ran blood today. At least, none that were caused by us.

Final Fantasy Q
OHR Developer BLOG
Official OHRRPGCE Wiki and FAQ
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP! All times are GMT - 8 Hours
Goto page Previous  1, 2, 3, 4  Next
Page 2 of 4

 
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