How to make character generation choices relevant?

Mareus
19 Jun 2014, 11:49
I am using character generator script found on the wiki page here:
http://quest5.net/wiki/Character_Creation

I am wondering how can I make the choices relevant to my game. For example if I choose a male, I want to be able to get a male picture when I type: examine player. This way I can simulate a character sheet. Or if I choose a warrior class, I want the picture to be that of a warrior.

Thanks in advance.

Pertex
19 Jun 2014, 16:41
You need to do something like this in a script:


if(player.gender="Male") {
picture (""male.jpg")
}

Mareus
19 Jun 2014, 20:01
Pertex wrote:You need to do something like this in a script:


if(player.gender="Male") {
picture (""male.jpg")
}


Thanks! It worked.

HegemonKhan
19 Jun 2014, 23:46
the same is for giving different Attributes too, an example:

Character Creation Scripting:

if (player.class_string = "warrior") {
player.strength_integer = 30
player.agility_integer = 15
} else if (player.class_string = "thief") {
player.strength_integer = 15
player.agility_integer = 30
}
if (player.gender_string = "male") {
player.strength_integer = player.strength_integer + 5
} else if (player.gender_string ="female") {
player.agility_integer = player.agility_integer + 5
}

Level Up ~ Leveling Scripting:

if (player.race_string = "human") {
player.strength_integer = player.strength_integer + 1
player.agility_integer = player.agility_integer + 1
} else if (player.race_string ="dwarf") {
player.strength_integer = player.strength_integer + 2
} else if (player.race_string = "elf") {
player.agility_integer = player.agility_integer + 2
}


---------------

an example method of *NOT* using the 'show menu' popup menu window:

<asl version="540">
<ref name="English.aslx" />
<ref name="Core.aslx" />
<game name="blah">
// blah code lines
<start type="script">
character_creation_function (player)
</start>
// blah code lines
</game>
// blah code tags and lines
//
//
// (start of) How the Parameters work:
//
// player -> object_x // player = object_x
// object_x -> object_x // object_x = object_x
// player -> object_x -> object_x // player = object_x = object_x
//
// end of 'How the parameters work'
//
//
<object name="global_data_object">
<inherit name="editor_object" />
<attr name="gender_type_string_character_creation_stringdictionary" type="simplestringdictionary">1=male;2=female</attr>
<attr name="race_type_string_character_creation_stringdictionary" type="simplestringdictionary">1=human;2=dwarf;3=elf;4=gnome;5=halfling;6=giant</attr>
<attr name="class_type_string_character_creation_stringdictionary" type="simplestringdictionary">1=warrior;2=ranger;3=thief;4=cleric;5=mage</attr>
</object>
<function name="character_creation_function" parameters="object_x">
alias_string_character_creation_function (object_x)
on ready {
age_character_creation_function (object_x)
on ready {
gender_type_string_character_creation_function (object_x)
on ready {
race_type_string_character_creation_function (object_x)
on ready {
class_type_string_character_creation_function (object_x)
on ready {
// name of the ' a function that... ' (object_x)
}
}
}
}
}
</function>
<function name="alias_string_character_creation_function" parameters="object_x">
if (object_x.name = "player") {
msg ("What is your name?")
get input {
object_x.alias = result
ClearScreen
}
}
</function>
<function name="age_character_creation_function" parameters="object_x">
age_amount_integer_character_creation_function (object_x)
on ready {
age_amount_integer_to_age_type_string_function (object_x)
}
</function>
<function name="age_amount_integer_character_creation_function" parameters="object_x"><![CDATA{
if (object_x.name="player") {
msg ("What is your age?")
get input {
if (ToInt (result) > 0) {
object_x.age_amount_integer = ToInt (result)
ClearScreen
} else {
ClearScreen
age_amount_integer_character_creation_function (object_x)
}
}
}
]]></function>
<function name="age_amount_integer_to_age_type_string_function" parameters="object_x"><![CDATA[
if (object_x.age_amount_integer >= 0 and object_x.age_amount_integer < 4) {
object_x.age_type_string = "baby"
} else if (object_x.age_amount_integer >= 4 and object_x.age_amount_integer < 13) {
object_x.age_type_string = "child"
} else if (object_x.age_amount_integer >= 13 and object_x.age_amount_integer < 20) {
object_x.age_type_string = "teen"
} else if (object_x.age_amount_integer >= 20) {
object_x.age_type_string = "adult"
}
]]></function>
<function name="gender_type_string_character_creation_function" parameters="object_x"><![CDATA[
if (object_x.name = "player") {
msg ("What is your gender?") {
msg ("(1) male or (2) female")
get input {
if (ToInt (result) > 0 and ToInt (result) < 3) {
object_x.gender_type_string = StringDictionaryItem (global_data_object.gender_type_string_character_creation_stringdictionary, result)
ClearScreen
} else {
ClearScreen
gender_type_string_character_creation_function (object_x)
}
}
}
]]></function>
<function name="race_type_string_character_creation_function" parameters="object_x"><![CDATA[
if (object_x.name = "player") {
msg ("What is your race?") {
msg ("(1) human, (2) dwarf, (3) elf, (4) gnome, (5) halfling, or (6) giant")
get input {
if (ToInt (result) > 0 and ToInt (result) < 7) {
object_x.race_type_string = StringDictionaryItem (global_data_object.race_type_string_character_creation_stringdictionary, result)
ClearScreen
} else {
ClearScreen
race_type_string_character_creation_function (object_x)
}
}
}
]]></function>
<function name="class_type_string_character_creation_function" parameters="object_x"><![CDATA[
if (object_x.name = "player") {
msg ("What is your class?") {
msg ("(1) warrior, (2) ranger, (3) thief, (4) cleric, or (5) mage")
get input {
if (ToInt (result) > 0 and ToInt (result) < 6) {
object_x.race_type_string = StringDictionaryItem (global_data_object.class_type_string_character_creation_stringdictionary, result)
ClearScreen
} else {
ClearScreen
class_type_string_character_creation_function (object_x)
}
}
}
]]></function>
// a function that has the pseodo-coding of ' if (player.Attribute = "blah") {, then player.Attribute = Value and player.Attribute = player.Attribute + Value' Scripts
</asl>