Nail/Hair Growth

Anonynn

your hair~nail growth stuff (aka 'growth' ) can be done a bunch of different ways....

1. current length integer * growth multiplier integer

hair length: 6 inches
growth multiplier integer: 2 (this is a bit too high~big for a multiplier ~ see below, lol. 1.0 to 1.5 would probably be better ~ or google what is the real growth multiplier~integer of actual~real hair growth, lol)

6 * 2 = 12 inches as new hair length (foot long hair now!)
12 * 2 = 24 inches as new hair length (2 foot long hair now!)
24 * 2 = 48 inches as new hair length (we're just about getting into repunsel ~ disney princess hair 'dragging on the floor' length, lol)
etc etc etc

2. current length integer + hair growth integer

hair length: 6 inches
hair growth: hair length + 2

6+2=8
8+2=10
10+2=12
etc etc etc

3. etc etc etc ways...

-------

as for the triggers... there's many ways as well...

the easiest being just directly using a Turnscript (or Timer), and~or using another Integer Attribute that is increasing (such as a 'day' Integer Attribute, which your 'growth' uses ~ is based off of), which has a trigger (such as, again, a Turnscript or a Timer).



Since this is a new/separate topic from the Clothing one, I figured it would be appropriate to post here instead.

I also figured a "Global TurnScript" would be the best way to go about it --- that way, if the player goes idle for something IRL, they don't come back with hair down to the floor, or ghastly 3 foot long nails or something lol. Leaving it a turn-script I think means every like...50 or 100 actions the player takes grows their hair and nails respectively.

So just to be clear doing it the global route...you....

Right Click the "game.object"
Add Turn-Script, select start when game begins
(then I don't know what to do from here)

or do you...

player.object
attributes (and since we already have "player.hairlength, player.nails" added in)
and add it here?

Also, HK keep working on the clothes sample game, I think you're making great progress so far. I say this because Pixie's Library is good but the clothing is locked to one particular outfit and there is no customization outside of wearing one thing at a time (which isn't bad, I just would like multiple and customization) and the "Wearables" library...although does allow customization in that regard, has errors when used with Pixie's combat library. So it's like....either have fully customizable clothes...but no combat, or have combat with no customizable clothes. There needs to be a middle ground....and HK...WE are the middle ground. *spooky lightning strike*

HegemonKhan
actually for me... it would probably be way more easy (I hope, lol) to figure out how to use Pixie's Library and Chase's Library together, than in me trying to create my own equipment system and making a sample game using it, lol.

I think I'm going to do that actually, as it should be easier~faster, than trying to craate my own equipment sample game for you (which even if I were able to create a sample game of my own, still would mean you'd have to then study it, and be able to use it as a guide to put in your own equipment system for your game file ~ which will probably not be easy for you as you'd need to understand it well, which you may not be at that level of yet, or maybe you are, as you're getting all this stuff quite fast and well, hehe).

------

I haven't looked at Chase's and Pixie's Libraries closely yet, but their systems may not have some complexity of design that you may want... as opposed to what system I've been trying to do on my own as a sample game for you (and failing miserably at, lol). So, maybe even with helping you to get Pixie's and Chase's libraries working teogether for your game file, I may still need to do some equipment work for anything that needs changing or is missing in what you'd want for your game (hopefully I could get some help from the much better coders here, as I am so struggling with it, lol).

HegemonKhan
as for the:

neonayon wrote:I also figured a "Global TurnScript" would be the best way to go about it --- that way, if the player goes idle for something IRL, they don't come back with hair down to the floor, or ghastly 3 foot long nails or something lol. Leaving it a turn-script I think means every like...50 or 100 actions the player takes grows their hair and nails respectively.

So just to be clear doing it the global route...you....

Right Click the "game.object"
Add Turn-Script, select start when game begins
(then I don't know what to do from here)

or do you...

player.object
attributes (and since we already have "player.hairlength, player.nails" added in)
and add it here?


neonayon wrote:Right Click the "game.object"


just to be clear...

on the left side's 'tree of stuff':

(going by 'my bad memory' of a new game, so it might be a bit off)

Objects <--- right click on this, and select 'add turnscript'
-> Game
->-> Verbs
->-> Commands
-> Room
->-> Player
Functions
Advanced
-> Object Types
-> Java Script
-> etc etc etc

you right click on the bolded 'Objects' shown above, and choose 'add a turnscript' to make a global turnscript (aka, it's not in a Room Object), which will create this new tree (the vertical placement location that quest will put your 'Turnscript' at, doesn't matter, so your tree may not match up with my example tree below):

Objects
-> Game
->-> Verbs
->-> Commands
-> Room
->-> Player
Turnscripts
-> your_turnscript -> (set it up: name it, check in the 'enabled' check box, and add the scrips for it)
Functions
Advanced
-> Object Types
-> Java Script
-> etc etc etc

a non-global (local) Turnscript:

Objects
-> Game
->-> Verbs
->-> Commands
-> Room <--- you right clicked on this, and choose 'add turnscript', creating the below local turnscript (may not look exactly like this, as I've never made~used a local turnscript, lol):
->-> (the local~specfiic 'room' Room Object) Turnscripts
->->-> your_turn_script
->-> Player
Functions
Advanced
-> Object Types
-> Java Script
-> etc etc etc

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

doing your 'intervals' (every 50~100 actions) isn't easy... that's the one really nice thing with using Timers, the intervals is easy as its done for you based upon real time (every XX seconds, do these scripts), whereas doing intervals with Integer Attributes and~or the internal code quest engine's 'turns~actions' via Turnscripts isn't so easy. Hmm...

if you've got a preset play limit on your game (you get 200 turns to play the game or you get 200 'days' Integer Attribute to play the game), then it will be more easy...

as we can create the intervals this way (this is a bit advanced, so you may not understand it, as you've probably not been exposed to this stuff yet):

http://docs.textadventures.co.uk/quest/scripts/for.html

<game name="xxx">
<attr name="turns" type="int">0</attr>
</game>

<turnscript name="global_turnscript">
hair_growth_function
game.turns = game.turns + 1
</turnscript>

<function name="hair_growth_function">
for (x, 0, 200, 50) {
if (game.turns = ToInt (x)) {
player.hair_length = player.hair_length + 2
msg ("Your hair grew anotehr 2 inches in length.")
}
}
</function>


----

if you don't want a preset play limit on your game, we could jsut do a preset limit on your hair growth (your hair growth will stop at turn 200, but you can keep plying the game into turn 1000), which would be done the same as above, actually, lol.

----

the problem is that we need a preset limit (max), otherwise, this will go on forever (endless processing, like an endless code loop = quest crashes):

(actually, I'm not sure if quest's 'for' allows for this, lol, though if we were using the 'foreach' we can have this issue created)

for (x, 0, no_max_limit, 50), would mean it forever does this:

on turn 0 -> do scripts
on turn 50 -> do scripts
on turn 100 -> do scripts
on turn 150 -> do scripts
etc etc etc
(quest will likely crash before it gets to the below turn, lol)
on turn 10000000000000000000000000000000000000000000000 -> do scripts
etc etc etc
on turn 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -> do scripts
etc etc etc

this is why we need that max limit... so it doesn't go on for ever and ever (nothing can go on forever, everything breaks down with use and over time: entropy, including quest and~or your computer's prcoessor~CPU, lol. Endless prcoessing is very bad, as the hardware can't endlessly process! Your basic calculutor, yourself as well, and even a quantum computer, all will break down before it finds the value of pi, laughs)

when I was a kid, I would challenge myself to how high I could verbally~speakingly count for without stopping...

1, 2, 3, 4, 5, 6, ..., 100, ... 200, etc etc etc...

serious fact: this is the best way to truly understand just how big a number really is !!!

when you just see '500', you're like 'pfft, that's small'... ya well, try counting to it... it ain't so small... !!!

don't even think about trying to count to 1,000.... laughs... you've no idea how long that takes... even while trying to count as fast as you can (you get super tired and out of breath if you even actually reach 1000, lol)

don't even imagine counting to 10,000 or more.... lol.

----

or, a different design is to work with a 'day' Integer Attribute, either:

increasing:

game.day = game.day + 1

or

cyclic (sunday to saturday -> sunday to saturday -> etc etc etc):

game.day = (game.day + 1) % 7

conceptually:

the % is the 'modulus' operator, it's basically division, except it only gives~returns~outputs~finds the remainder value

game.day = 0 % 7 -> 0 / 7 -> Remainder 0 -> day 0
game.day = 1 % 7 -> 1 / 7 -> Remainder 1 -> day 1
game.day = 2 % 7 -> 2 / 7 -> Remainder 2 -> day 2
game.day = 3 % 7 -> 3 / 7 -> Remainder 3 -> day 3
game.day = 4 % 7 -> 4 / 7 -> Remainder 4 -> day 4
game.day = 5 % 7 -> 5 / 7 -> Remainder 5 -> day 5
game.day = 6 % 7 -> 6 / 7 -> Remainder 6 -> day 6
game.day = 7 % 7 -> 7 / 7 -> Remainder 0 -> day 0
game.day = 8 % 7 -> 8 / 7 -> Remainder 1 -> day 1
game.day = 9 % 7 -> 9 / 7 -> Remainder 2 -> day 2
game.day = 10 % 7 -> 10 / 7 -> Remainder 3 -> day 3
game.day = 11 % 7 -> 11 / 7 -> Remainder 4 -> day 4
game.day = 12 % 7 -> 12 / 7 -> Remainder 5 -> day 5
game.day = 13 % 7 -> 13 / 7 -> Remainder 6 -> day 6
game.day = 14 % 7 -> 14 / 7 -> Remainder 0 -> day 0
game.day = 15 % 7 -> 15 / 7 -> Remainder 1 -> day 1
game.day = 16 % 7 -> 16 / 7 -> Remainder 2 -> day 2
game.day = 17 % 7 -> 17 / 7 -> Remainder 3 -> day 3
game.day = 18 % 7 -> 18 / 7 -> Remainder 4 -> day 4
game.day = 19 % 7 -> 19 / 7 -> Remainder 5 -> day 5
game.day = 20 % 7 -> 20 / 7 -> Remainder 6 -> day 6
game.day = 21 % 7 -> 21 / 7 -> Remainder 0 -> day 0
game.day = 22 % 7 -> 22 / 7 -> Remainder 1 -> day 1
etc etc etc


day 0: sunday
day 1: monday
day 2: tuesday
day 3: wednesday
day 4: thursday
day 5: friday
day 6: saturday
day 0: sunday
day 1: monday
day 2: tuesday
day 3: wednesday
day 4: thursday
day 5: friday
day 6: saturday
day 0: sunday
day 1: monday
day 2: tuesday
day 3: wednesday
day 4: thursday
day 5: friday
day 6: saturday
day 0: sunday
day 1: monday
day 2: tuesday
day 3: wednesday
day 4: thursday
day 5: friday
day 6: saturday
etc etc etc
etc etc etc


<game name="xxx">
<attr name="day" type="int">0</attr>
</game>

<turnscript name="global_turnscript">
if (game.day = 3) {
// once a week (on wednesday), your hair grows another 2 inches
plauer.hair_length = player.hair_length +2
}
game.day = (game.day + 1) % 7
</turnscript>

Anonynn
That does make sense, haha.

I don't mind having a max limit actually. If the player starts off with short nails....then they can grow about an inch long at max...and if the player's hair starts off shoulder length then it can only grow until it touches the floor. That would make sense.

Is there a way to do the max on a turn-script? I don't know how many turns the game is so far, all I know is it's 147 "word" pages long at the moment.

I'd need help with that starting that.

So I go...
(Tree of Stuff)
Object.
Add Turn-Script

(I made three)
nail_growth
hair_growth

I enabled them to start when the game begins.

I'd rather not do a day thing in the game since I sort of want to control that in the context of the story. Plus, I don't know how to make time pass by in the game and have it make sense in the descriptions. Like for example, I would want to have a clock...and then have the room described as being daytime and the player's clock says 8pm because they've just been fiddling with commands in the same room.



Also, combining the clothing libraries would be fine too. I don't mind if you can figure out why you can't use them together. Wearables and Pixie's Combat. All I know is it comes up with that very strange error.

The Pixie
Try something like this for the nail turn script:
player.nail_count = player.nail_count + 1
if (player.nail_count = 50 and player.nail_length < 20) {
player.nail_count = 0
player.nail_length = player.nail_length + 1
}

You will need to create integer attributes on the player called nail_count and nail_length. This will fire every 50 turns, and the length is capped at 20.

Anonynn
The Pixie wrote:Try something like this for the nail turn script:
player.nail_count = player.nail_count + 1
if (player.nail_count = 50 and player.nail_length < 20) {
player.nail_count = 0
player.nail_length = player.nail_length + 1
}

You will need to create integer attributes on the player called nail_count and nail_length. This will fire every 50 turns, and the length is capped at 20.


Ah, alright. Thanks Pixie!

So is that...
nail_growth (Turn-Script)
Add New Script.
Set A Variable or Attribute?

Or is that done on the player tab under attributes?

HegemonKhan
first, you need to create~add~give your two 'nail' and two 'hair' Attributes to your 'player' Player Object:

'player' Player Object -> 'Attributes' Tab -> Attributes -> Add -> (see below, repeat as needed)

(Object Name: player)
Attribute Name: nail_length
Attribute Type: int (integer)
Attribute Value: 0

(Object Name: player)
Attribute Name: nail_count
Attribute Type: int
Attribute Value: 0

(Object Name: player)
Attribute Name: hair_length
Attribute Type: int
Attribute Value: 0

(Object Name: player)
Attribute Name: hair_count
Attribute Type: int
Attribute Value: 0

---------

then for your (global) Turnscript:

(you can change the '20' numbers which are the max length for your nail and hair with the way Pixie's setup~method is done, to whatever numbers you want)

(you can also change the '50' numbers to whatever you want, this is the 'per every X turns do these scripts' number in how Pixie's setup~method is done)

right click on the upper-left-most 'Objects' in the left side's 'tree of stuff', and select 'add turnscript'

Turnscript Name: global_turnscript
Enabled check box: have it checked in
Scripts: (see below)

add a~new script -> variables -> 'set a variable or attribute' Script -> set variable player.nail_count = [expression] player.nail_count + 1

add a~new script -> variables -> 'set a variable or attribute' Script -> set variable player.hair_count = [expression] player.hair_count + 1

add a~new script -> scripts -> 'if' Script -> if [expression] player.nail_count = 50 and player.nail_length < 20

-> then -> add a~new script -> variables -> 'set a variable or attribute' Script -> set variable player.nail_count = [expression] 0

-> add a~new script -> variables -> 'set a variable or attribute' Script -> set variable player.nail_length = [expression] player.nail_length + 1

-> add a~new script -> output -> 'print message' Script -> print [message] You're nails grew another centimeter.

add a~new script -> scripts -> 'if' Script -> if [expression] player.hair_count = 50 and player.hair_length < 20

-> then -> add a~new script -> variables -> 'set a variable or attribute' Script -> set variable player.hair_count = [expression] 0

-> add a~new script -> variables -> 'set a variable or attribute' Script -> set variable player.hair_length = [expression] player.hair_length + 1

-> add a~new script -> output -> 'print message' Script -> print [message] You're hair grew another inch.

Anonynn
Yay! I got it to work....the only problem is...

You appear to be a average human, with normal human skin, and a human face. You are 5'7 feet tall, and appear thin as well. You also have 0 brunette hair, muddy brown eyes, human ears and thin lips too. As for the rest of your body, you have nice tiny A-cup breasts, narrow hips, and no tail above your average butt. You have human hands with 0 and human feet as well, and are not pregnant yet. You are a virgin, straight and Not Corrupted.

The POV code is...(and I apologize if this isn't appropriate)

{random:You are a:You look like a:You appear to be a} {player.appearance} {player.race}, with {player.skin} skin, and a {player.face} face. {random:You stand at:You are} {player.height} feet tall, and appear {player.weight} as well. You also have {player.hairlength} {player.haircolor} hair, {player.eyecolor} eyes, {player.ears} ears and {player.lips} lips too. {random:As for the rest of your body, you have:Your body has:} {random:nice:succulent:cute:beautiful:sexy} {player.breastsize} breasts, {player.hips} hips, and {player.tailtype} above your {player.butt}. You have {player.hands} hands with {player.nails} and {player.feet} feet as well, and are {player.pregnant}. You are a {player.virginity}, {player.orientation} and {player.corruption}.

So is there a way for that to make sense like...your hair/nails are "0" inches long etc?

HegemonKhan
you actually seem to have merely only left out a few words in your code (only two parts with the needed added words), here's the fixes:

(I'll bold and enlarge the added words, there's only 2 bolded+enlarged parts below, so you can hopefully see~spot them easier ~ my eyes are bad, its hard for me to see the bolded vs non-bolded text, lol)

{random:You are a:You look like a:You appear to be a} {player.appearance} {player.race}, with {player.skin} skin, and a {player.face} face. {random:You stand at:You are} {player.height} feet tall, and appear {player.weight} as well. You also have {player.hairlength} inches long {player.haircolor} hair, {player.eyecolor} eyes, {player.ears} ears and {player.lips} lips too. {random:As for the rest of your body, you have:Your body has:} {random:nice:succulent:cute:beautiful:sexy} {player.breastsize} breasts, {player.hips} hips, and {player.tailtype} above your {player.butt}. You have {player.hands} hands with {player.nails} inch long nails and {player.feet} feet as well, and are {player.pregnant}. You are a {player.virginity}, {player.orientation} and {player.corruption}.

and here it is in code, so you can easily highlight, copy, and paste it, if you want to into your game:

{random:You are a:You look like a:You appear to be a} {player.appearance} {player.race}, with {player.skin} skin, and a {player.face} face. {random:You stand at:You are} {player.height} feet tall, and appear {player.weight} as well. You also have {player.hairlength} inches long {player.haircolor} hair, {player.eyecolor} eyes, {player.ears} ears and {player.lips} lips too. {random:As for the rest of your body, you have:Your body has:} {random:nice:succulent:cute:beautiful:sexy} {player.breastsize} breasts, {player.hips} hips, and {player.tailtype} above your {player.butt}. You have {player.hands} hands with {player.nails} inch long nails and {player.feet} feet as well, and are {player.pregnant}. You are a {player.virginity}, {player.orientation} and {player.corruption}.


-----

P.S.

off-topic...

if you're interested, there's a decent-good neko romantic comedy anime (its a funny parody of 'dogs' vs 'cats' ), though it does have fanservice for males, but if you don't mind, I actually liked it, and would recommend it to you. The nekos and canines are technological advanced aliens, who come to earth. It has a good story, a good love~romance triangle story, (though be warned: there's some very sad parts too, as this is what often makes for a good love~romance story), and the fight scenes are really incredible (though there's not too many of them), if you're into fight scenes (generally more of a guy~male interest though, laughs). It has some good characters too. Oh and there's these really cute, funny, and cool 'robot minions' as well. Let me know if you are interested.

Anonynn
if you're interested, there's a decent-good neko romantic comedy anime (its a funny parody of 'dogs' vs 'cats' ), though it does have fanservice for males, but if you don't mind, I actually liked it, and would recommend it to you. The nekos and canines are technological advanced aliens, who come to earth. It has a good story, a good love~romance triangle story, (though be warned: there's some very sad parts too, as this is what often makes for a good love~romance story), and the fight scenes are really incredible (though there's not too many of them), if you're into fight scenes (generally more of a guy~male interest though, laughs). It has some good characters too. Oh and there's these really cute, funny, and cool 'robot minions' as well. Let me know if you are interested.[/quote]

You didn't tell me what it was called lol. But yeah sounds kind of interesting! Also, thank you so much on that coding help so far! The Nail and Hair Growth worked out perfectly.

Is there a way for the player to "cut" them though? Like, or have NPC's capable of cutting it?

HegemonKhan
ya, there's many ways to cut (reduce or reset) your hair~nail length, for just one simple method:

'npc' Object -> 'Verbs' Tab -> Add -> Name: cut~trim~manicure~etc lol

'cut' Verb:

add a~new script -> variables -> 'set a variable or attribute' Script -> (see below)

there's different math operations on doing it of course... but they all are generally doing same thing..

to reduce (subtract):

(change to what your Attribute names are)

set variable player.nail_length = [expression] player.nail_length - 2

to reset (such as back to zero):

set variable player.nail_length = [expression] 0

division reduction:

set variable player.nail_length = [expression] player.nail_length / 2

etc etc etc ways of lowering-shortening~raising-lengthening your nails~hair length too.

----

and you can do a lot more intricacy too of choices~options too, such as conceptually:

hi, how short would you like your nails cut?

hi, how long would you like your hair to be cut?

hi, how long would you like your hair to grow in length?

hi how long would you like your nails to grow in length?

etc etc etc

-----

off-topic:

oops, sorry, forgot to give the name of the neko anime laughs:

title (japanese): Asobi ni Iku yo!
alternative english title 1: Bombshells from the Sky
alternative english title 2: Cat Planet Cuties

it's only 12 episodes long, 1 season only

and I just love its 'lonely spaceman' song (japanese and english), though I am a nerd, laughs.

Anonynn

ways of lowering-shortening~raising-lengthening your nails~hair length too.



So I got all the other stuff to work, but came across a problem! When someone can cut their own hair for example, the integers can go "negative" ...like -11 inches of hair. Is there a way to cap the min at 0?

And with that asked...is there a way to say that when someone has "0" inches of hair, to say "You have 0 inches of hair making you bald?"

Thank you for all the help so far, HK and Pixie.

-----

off-topic:

oops, sorry, forgot to give the name of the neko anime laughs:

title (japanese): Asobi ni Iku yo!
alternative english title 1: Bombshells from the Sky
alternative english title 2: Cat Planet Cuties

it's only 12 episodes long, 1 season only

and I just love its 'lonely spaceman' song (japanese and english), though I am a nerd, laughs.



I'll have to check it out, it sounds interesting.

HegemonKhan
neonayon wrote:When someone can cut their own hair for example, the integers can go "negative" ...like -11 inches of hair. Is there a way to cap the min at 0?


----------

I'm using the 'hair_length' as an example for this post, but you'll want to do this stuff for your 'hair_length', 'nails~nail_length', and any other like-stuff~Attributes that you may have (teeth length? claw length?, fur length?, body height?, body weight?, life?, mana?, and etc etc etc growth~increase or shrinkage~decrease stuff).

---------

you'll need to add an 'if' Script (after~below your 'cut hair~nail' Scripts):

if [expresssion] player.hair_length < 0
(use~add the 'set a variable or attribute' Script) ----> set variable player.hair_length = [expression] 0

--------

conceptually:

if hair length is less than 0 (negative), then hair length is set to being at 0.


--------

if you're interested in a max limit, here's how:

first, create a max Attribute:

'player' Player Object -> 'Attributes' Tab -> Attributes -> Add -> (see below)

(Object Name: player)
Attribute Name: maximum_hair_length
Attribute Type: int
Attribute Value: 100

then for~in your 'how long would you like to grow your hair' Verb~Scripting (after~below your 'increased hair length' Scripts):

again, add an 'if' Script:

if [expresssion] player.hair_length > player.maximum_hair_length
(use~add the 'set a variable or attribute' Script) ----> set variable player.hair_length = [expression] player.maxium_hair_length

--------

conceptually:

if hair length is greater than the maximum hair length, then hair length is set to being equal to the maximum hair length (in this example that would be: 100, as I set~added the max Attribute as: player.maximum_hair_length = 100).


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

neonayon wrote:And with that asked...is there a way to say that when someone has "0" inches of hair, to say "You have 0 inches of hair making you bald?"


http://docs.textadventures.co.uk/quest/ ... essor.html

we'll be using this text processor command:

{if object.attribute=value:text}
Display text only if an object attribute equals a certain value.

actually, I think you've got this in your game code somewhere anyways, so you'll just need to adjust~change it, as seen below.

(your message is much longer than this, so this is just the part you want to change~adjust of your entire message block)

print [expression] "xxx. You have {player.hair_length} inch long {player.hair_color} hair {if player.hair_length=0: making you bald}. xxx."

----

output (if player.hair_length is not 0), example:

You have 50 inch long black hair.

output (if player.hair_length is 0), example:

You have 0 inch long black hair making you bald.

Anonynn
Wow, this is great! Thank you so much HK! I hope this not only helps me but other people interested in using these codings as well.

I only have like...a million more things I need help with! Woo.


lol

That's the end of this thread! I think...

This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums