Post new topic    
Liquid Metal Slime
Send private message
Character Selection Menu 
 PostWed Apr 06, 2011 2:03 am
Send private message Reply with quote
I want to make a menu that allows the player to select from 1 of 3 characters before they start a new game. I asked about this several months ago in a different thread and ended making a solution with text boxes and NPCs but now that my scripting skills are little better, I'd like to incorporate this as a script.

Here's what I've started. I've created a script that runs when you start a new game. This opens a menu with 3 choices labeled "robot" "cyborg" and "android." Robot is hero 0 inside custom.exe so he is assumed to be the default hero.

When you select one of the choices, one of the following 3 scripts should run:

Code:

plotscript, addrobot, begin
add hero (robot)
swap by position (0,1)
delete hero (robot)
close menu (1)
end


Code:

plotscript, addcyborg, begin
add hero (cyborg)
swap by position (0,1)
delete hero (robot)
close menu (1)
end


Code:

plotscript, addandroid, begin
add hero (android)
swap by position (0,1)
delete hero (robot)
close menu (1)
end


The idea is that each script will (1) add the hero (2) swap him so he's the first slot in the party (3) delete the default character - robot and (4) close the menu

The "addrobot" script is redundant since technically robot is already part of the party, but I added it here for purposes of demonstration.

One thing that is a problem is that I don't know how to define my heros is constants. How do I do that?

Beyond that, will this actually work? Or is there an easier way to do this?

Thanks in advance!
Super Slime
Send private message
 
 PostWed Apr 06, 2011 4:04 am
Send private message Reply with quote
That works.

You want to export an HSI file (it's in the same menu as Import script), which will automatically have all your constants.
Mega Tact v1.1
Super Penguin Chef
Wizard Blocks
Liquid Metal Slime
Send private message
 
 PostThu Apr 07, 2011 12:45 pm
Send private message Reply with quote
Got it! Thanks Mogri. Although, interestingly, my "add hero ()" command needed to reference the hero number, not the hero name. This is contrary to what it says in the plotscripting dictionary on the wiki.
Liquid Metal King Slime
Send private message
 
 PostThu Apr 07, 2011 3:23 pm
Send private message Reply with quote
Willy Elektrix wrote:
Got it! Thanks Mogri. Although, interestingly, my "add hero ()" command needed to reference the hero number, not the hero name. This is contrary to what it says in the plotscripting dictionary on the wiki.


The hero name is just an alternate way of writing the hero ID number.

Did you get an error message when you tried to use hero name? If so, what did it say?
Metal Slime
Send private message
 
 PostThu Apr 07, 2011 5:13 pm
Send private message Reply with quote
Willy Elektrix wrote:
Got it! Thanks Mogri. Although, interestingly, my "add hero ()" command needed to reference the hero number, not the hero name. This is contrary to what it says in the plotscripting dictionary on the wiki.


that's because you have to list the constant like it appears in your .hsi file. i noticed your script looked like this:

Code:
add hero (android)
delete hero (android)


when it should look more like this:

Code:
add hero (Hero:android)
delete hero (Hero:android)

Hey, I just met you, and this is crazy... So here's some lunchmeat... Sandwich, maybe?
Slime Knight
Send private message
 
 PostSun Apr 10, 2011 1:54 pm
Send private message Reply with quote
I hope we can look at the characters and get information about them before making the decision.

It might not be a bad idea to attach a textbox to that script, detailing you on the character, providing you with a portrait, and asking for confirmation.
Liquid Metal Slime
Send private message
 
 PostTue Apr 12, 2011 1:17 pm
Send private message Reply with quote
Sh4d0ws wrote:
I hope we can look at the characters and get information about them before making the decision.

It might not be a bad idea to attach a textbox to that script, detailing you on the character, providing you with a portrait, and asking for confirmation.


Already got this. Thanks for the suggestion though. I've got a text box that includes characters images as well as stats for each that appears appears above the menu.
Display posts from previous: