@Loudbeat I read that but just wanted to make sure I understand it as I am new to coding.
@choicehacker So it seems to be no problem to *goto different scenes without returning to a gosub.
Thanks
@Loudbeat I read that but just wanted to make sure I understand it as I am new to coding.
@choicehacker So it seems to be no problem to *goto different scenes without returning to a gosub.
Thanks
No problem, I always try to reinforce my response with the documentation, not all out there know that itâs there.
Oh, no. I havenât tried it myself, but thatâs simply because Iâm sure itâll cause problem later down the line. Use *return
for every *gosub
you have.
If you were to have a *gosub
but uses *goto
instead to return to main passage, itâll cause problem if you were to have a *return
somewhere down the line. Your reader will be thrown back all the way to the initial *gosub
line and all their stats will be reset back to that point in case of *gosub_scene
.
In fact, a good coding practice would be to write down *return
in pair-with every *gosub
as you type and put your code in-between.
Rereading this, itâs theoretically no problem if you were to exclusively use *gosub
only and *goto
only in your code. However, Iâm not even holding my breath to see if everything is going to be fine or not if I do such setup.
This is what I was thinking as well⌠but as I am new to coding I am not sure of how to fix it easily.
I have the MC meeting a character which can happen at different parts in the story, hence I made a *gosub to that section with a return in it which I thought would be easier then figuring out where the MC came from. But I also want to give the player the option to get out of this conversation at some point in the *gosub, so I made a *goto back to the âmain menuâ
I am trying to finalise all this and will get this part of the chapter up in the workshop, hoping to get some tips there, but if you see some easier solution it would be very helpful
I might understand the problem youâre facing which, if I am, might something that requires special treatment to see whether itâll work in your story or not. Having the code (or the story) up for public testing might be the best; and from there, I can take a peek at how you structure your code and give some insights.
If the player decides to quit, instead of using a *goto
, just use a *return
. You can use more than one *return
statement, but the player will hit only one. Just hide it inside an *if
statement or a *choice
body.
Yeah, how I wrote it, I donât want to player to return to that point anymore as he does not wants to interact with the met character. I think I just overcomplicated it all. I will follow @Szaal 's advice and finish what I have in the coming week and post it.
Thanks for helping
Years later, I know, but thanks for typing this out: clear, conciseâexactly what I needed. Cheers!
Whatâs the coding for money? i.e. A resource thatâs shown in your inventory, which you canât spend more of than you possess.
just set a variable and name it whatever you want. for an example of not spending more than what you have:
*fake_choice
#Buy a dope fanny pack
*if money > 10
Nice! You got a new fanny pack! Pretty dope!
*if money < 10
Bummer dude.... no fanny pack for you! You need some money.
#Don't buy a dope fanny pack
just change out the values and text, that will work for most things
So. I made a highest_calc script, and want to see what everyone thinks. Please comment if you find arrors.
*if Highest_relationship_stat = 51
*set Highest_relationship "t_relationship"
*set Highest_relationship_stat t_relationship
*elseif friendship_stat =50
*set friendship_stat "l_relationship"
*set friendship_stat_stat l_relationship
*if t_relationship > Highest_relationship_stat
*set Highest_relationship "t_relationship"
*set Highest_relationship_stat t_relationship
*elseif ((t_relationship >friendship_stat_stat and <highest_relationship_stat
*set friendship_stat "t_relationship"
*set friendship_stat_stat t_relationship
*if l_relationship > Highest_relationship_stat
*set Highest_relationship "l_relationship"
*set Highest_relationship_stat l_relationship
*elseif ((l_relationship >friendship_stat_stat and <highest_relationship_stat
*set friendship_stat "l_relationship"
*set friendship_stat_stat l_relationship
*if n_relationship > Highest_relationship_stat
*set Highest_relationship "n_relationship"
*set Highest_relationship_stat n_relationship
*elseif ((n_relationship >friendship_stat_stat and <highest_relationship_stat
*set friendship_stat "n_relationship"
*set friendship_stat_stat n_relationship
*if d_relationship > Highest_relationship_stat
*set Highest_relationship "d_relationship"
*set Highest_relationship_stat d_relationship
*elseif ((d_relationship >friendship_stat_stat and <highest_relationship_stat
*set friendship_stat "d_relationship"
*set friendship_stat_stat d_relationship
*return
*gosub_scene high_relationship_calc
*if Highest_relationship = "t_relationship"
*goto_scene driver t_reaction_shoulder2
*elseif second_highest_relationship ="t_relationship"
*goto_scene driver t_reaction_shoulder2
*if Highest_relationship = "l_relationship"
*goto_scene driver l_reaction_shoulder2
*elseif second_highest_relationship ="l_relationship"
*goto_scene driver l_reaction_shoulder2
*if Highest_relationship = "n_relationship"
*goto_scene driver n_reaction_shoulder2
*elseif second_highest_relationship "n_relationship"
*goto_scene driver n_reaction_shoulder2
*if Highest_relationship = "d_relationship"
*goto_scene driver d_reaction_shoulder
*elseif second_highest_relationship ="d_relationship"
*goto_scene driver d_reaction_shoulder2
So. Yeah.
Hi @ArchivistAlpha096 , congratulations for your effort. I had a look at it, but the code is very dense and rather hard to analyze. Where are the two constants 51 and 50 coming from?
For sorting, I always refer to @stainedofmind 's implementation, which is in my opinion the most elegant piece of CS ever written. You can find it here: Algorithm hall of fame and code examples: sorting, shuffling, dev tools
The 50 and51 come from the 2 relationship stats. Figured I should the âhighest_relationship_statâ 1 above the âfriendship_statâ just to keep things focused.
Yeah, it is. I didnât bother double spaceing it, because itâs ment to be strictly backround code.
Ok, Iâm confused. Iâm running my code on firefox. Also. Seems it wants you to uploade the entire folder now, which I donât like utch. Anyway. I have this:
*set k_gender "female"
I donât know why itâs giveing me an arror, and am somewhat confused as to whatâs going on here? So⌠YeahâŚ
Time to resurrect this for a little help: how do you code does not equal into an *if? I think it was something with an equal sign and a backslash but I donât know specifics.
Itâs !=
Thanks!
This topic was automatically closed 24 hours after the last reply. If you want to reopen your WiP, contact the moderators.
Hello, various and sundry coders. I was doing some playtesting for my game in the publication queue and realized the below subroutine code doesnât cover if someone has more than one of these stats at an equal level; an epilogue chunk failed to trigger because it required one of the four to be in place. Any thoughts on how to force it to pick one if there are multiple at an equal level?
*if Highest_stat = 0
*set Highest_stat_type "Intimidate"
*set Highest_stat intimidate
*if Intimidate > Highest_stat
*set Highest_stat_type "Intimidate"
*set Highest_stat intimidate
*if Inspire > Highest_stat
*set Highest_stat_type "Inspire"
*set Highest_stat inspire
*if Motivate > Highest_stat
*set Highest_stat_type "Motivate"
*set Highest_stat motivate
*if Entertain > Highest_stat
*set Highest_stat_type "Entertain"
*set Highest_stat entertain
*return