Hello !
I've benn playing teases for a long time and now I was thinking I wanted to create one that would be "game like" (like Futa Island on CHYOA if you know it). I'd like to make the player be able to pick up items to use later with a check if they have them. Should I do something like "Item=True;" ?
I understand coding (I think) but I've never studied it. So does anybody has either a ressource that would help so I won't ask for every problem I have or the direct solution for this one ?
First webstease - Coding help for getting items
- Augustulus
- Explorer At Heart

- Posts: 659
- Joined: Fri Dec 25, 2015 4:27 pm
- Gender: Male
- Sexual Orientation: Open to new ideas!
- I am a: Switch
Re: First webstease - Coding help for getting items
Hey
,
great, that you want to try and make your first tease
.
I may not the best to help you especially with teases but I have decent experience with coding.
I also skipped only a little bit through "Futa Island", but couldn't really determine how items are handled there.
In general I would say that you should go with less variables to keep the overview. You can for example have a variable called "playerUnderwear". You then assign a string to this variable with the type of underwear the player is currently wearing. For example if the player removes all his clothes it could be something like this: playerUnderwear = "none";
If then the player buys a thong you would set the variable to playerUnderwear = "thong";
There is also the possibility to create arrays, that hold more than one value. Like if you want to have an inventory for the player.
You might find help here:
Lastly: creating things (like teases) that are not linear can get really complex in a short time. From my experience it is best to start with as little as possible and then consecutively add new things. Therefore you might want to think about a simple to use and extendable system for your items before doing too much of the story.
Hope that I could help a little bit,
Augustulus
great, that you want to try and make your first tease
I may not the best to help you especially with teases but I have decent experience with coding.
I also skipped only a little bit through "Futa Island", but couldn't really determine how items are handled there.
In general I would say that you should go with less variables to keep the overview. You can for example have a variable called "playerUnderwear". You then assign a string to this variable with the type of underwear the player is currently wearing. For example if the player removes all his clothes it could be something like this: playerUnderwear = "none";
If then the player buys a thong you would set the variable to playerUnderwear = "thong";
There is also the possibility to create arrays, that hold more than one value. Like if you want to have an inventory for the player.
You might find help here:
- variables: https://www.w3schools.com/js/js_variables.asp
- arrays: https://www.w3schools.com/js/js_arrays.asp
- comparison: https://www.w3schools.com/js/js_comparisons.asp
Lastly: creating things (like teases) that are not linear can get really complex in a short time. From my experience it is best to start with as little as possible and then consecutively add new things. Therefore you might want to think about a simple to use and extendable system for your items before doing too much of the story.
Hope that I could help a little bit,
Augustulus
Re: First webstease - Coding help for getting items
I would start here:Thusa wrote: Fri Jul 23, 2021 11:54 pm does anybody has either a ressource that would help so I won't ask for every problem I have or the direct solution for this one ?
viewtopic.php?f=2&t=22570
-
Thusa
- Curious Newbie

- Posts: 4
- Joined: Wed Dec 02, 2015 8:27 pm
- Gender: Male
- Sexual Orientation: Straight
- I am a: None of the above
Re: First webstease - Coding help for getting items
I'm already using this as a reference and it's amazing.
Having a few issues with the true/false statments but thanks !
Having a few issues with the true/false statments but thanks !
Re: First webstease - Coding help for getting items
In your Init Script, do something like:Thusa wrote: Sat Jul 24, 2021 7:04 pm I'm already using this as a reference and it's amazing.
Having a few issues with the true/false statments but thanks !
Code: Select all
var items = {
a: false,
b: false,
c: false,
// and so on...
}
Then, in an eval action where you want to enable in item, do:
Code: Select all
items.a = true // set item "a"
// or you could do
items.b = true // set item "b"
// and so on...
Code: Select all
items.a-
Thusa
- Curious Newbie

- Posts: 4
- Joined: Wed Dec 02, 2015 8:27 pm
- Gender: Male
- Sexual Orientation: Straight
- I am a: None of the above
Re: First webstease - Coding help for getting items
Wow thanks that's awsome !
I'll need to play around with that to fully understand but that's tremendous help.
Just to be sure, do i need to write the // ?
I'll need to play around with that to fully understand but that's tremendous help.
Just to be sure, do i need to write the // ?
-
Thusa
- Curious Newbie

- Posts: 4
- Joined: Wed Dec 02, 2015 8:27 pm
- Gender: Male
- Sexual Orientation: Straight
- I am a: None of the above
Re: First webstease - Coding help for getting items
Ok i just tried with the IF and it works, it enven solved an issue I had when i stored everything not in tables (i don't know if that's the term).
Thank you again
Thank you again
