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

Creating a revival shop/Main Menu scripting

 
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP!
View previous topic :: View next topic  
Author Message
PK-Gamer
Currently making an RPG




Joined: 11 Jan 2013
Posts: 23
Location: MD

PostPosted: Mon Jan 20, 2014 8:23 am    Post subject: Creating a revival shop/Main Menu scripting Reply with quote

Hi all,

I'm trying to create a shop that revives allies. Basically, the npc asks who needs to be revived and the player choose the ally that needs to be revived.

And for the allies that are alive that are selected a message needs to come up saying, "this person is already alive."

Is this possible to be created.


Last edited by PK-Gamer on Tue Jan 21, 2014 9:53 am; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
Bob the Hamster
OHRRPGCE Developer




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

PostPosted: Mon Jan 20, 2014 8:34 am    Post subject: Reply with quote

Hello! Yes, this is possible. You can't do this with the built-in shops, but you can do it with a plotscript. Here is a simple plotscript that should do the job

Code:

plotscript, revive allies, begin
  show text box(1) # Who do you wish to revive?
  wait for text box
  variable(slot)
  slot := pick hero
  if(slot == -1) then(
    # The player canceled
    show text box(1) # Perhaps another time.
    wait for text box
    exit script
  )
  variable(hp)
  hp := get hero stat(slot, stat:HP, current stat)
  if(hp > 0) then(
    # Already alive
    show text box(2) # This one is not in need of my services
    wait for text box
    exit script
  )
  show text box(3) # Now I shall perform the rites of revivification!
  wait for text box
  hp := get hero stat(slot, stat:HP, maximum stat)
  set hero stat(slot, stat:HP, hp, current stat)
end


If you want an explanation of how the script works line-by-line, just let me know.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
PK-Gamer
Currently making an RPG




Joined: 11 Jan 2013
Posts: 23
Location: MD

PostPosted: Tue Jan 21, 2014 9:54 am    Post subject: Reply with quote

Thanks Bob!

I also had another question (I don't want to create new thread after thread...)

Is there a way for the player not to open the main menu? As in somewhere in a plotscript it prevents the player to not open the main menu while playing and in another plotscript, it makes the player able to open the main menu again?
Back to top
View user's profile Send private message Visit poster's website
Bob the Hamster
OHRRPGCE Developer




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

PostPosted: Tue Jan 21, 2014 11:23 am    Post subject: Reply with quote

If you are using the nightly WIP builds, then scripting this is super-easy.

Code:

plotscript, menu handler, begin
  if(check tag(tag:menu disabled) == false) then(
    main menu
  )
end


Then you go to "Edit General Game Data" -> "Special Plotscripts" and set "Menu-Action plotscript:" to the "menu handler" script.

If you are using the beelzebufo stable release it is still possible to script a feature like this, but it is a lot more complicated. If you want to stick with the stable release, let me know and I can explain the other method.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
TMC
On the Verge of Insanity




Joined: 05 Apr 2003
Posts: 3240
Location: Matakana

PostPosted: Wed Jan 22, 2014 2:41 am    Post subject: Reply with quote

To prvent James from wasting time explaining the other way, it's documented here: How can I run a script instead of/before/after the menu comes up? (But now that page needs an update)
_________________
"It is so great it is insanely great."
Back to top
View user's profile Send private message Send e-mail MSN Messenger
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