Remember to remove the $You can use this:
or, if you need to specity day night cycle:Code:if $ day == 20: whatyouwannado
Code:if $ day == 20 and $ time == 1: whatyouwannado
If statements do not take Python statements like that.
Remember to remove the $You can use this:
or, if you need to specity day night cycle:Code:if $ day == 20: whatyouwannado
Code:if $ day == 20 and $ time == 1: whatyouwannado
Ups, yes, sometimes memory betrays me x'DRemember to remove the $
If statements do not take Python statements like that.
menu:
"Pay 25 coins?"
"yes":
if money >= 25:
$ money -= 25
bo "good night"
$ day += 1
$ time = 0
call updatestats from _call_updatestats15
jump mainMenu
elif money >= 24:
$ money +=0
bo "you cant afford it!"
jump mainMenu
elif money == 0:
bo "you cant afford it!"
jump mainMenu
elif day == 20:
jump map
thank you HopesGaming..
i tried this code before without any functions, i don't get an error.
it just wont trigger.
can it be that it needs a specific place? i was hoping i could write all this events on my event file...
or is my sleepcode the problem?
Code:menu: "Pay 25 coins?" "yes": if money >= 25: $ money -= 25 bo "good night" $ day += 1 $ time = 0 call updatestats from _call_updatestats15 jump mainMenu elif money >= 24: $ money +=0 bo "you cant afford it!" jump mainMenu elif money == 0: bo "you cant afford it!" jump mainMenu elif day == 20: jump map
menu:
if day == 20:
jump map
else:
"Pay 25 coins?"
"yes":
if money >= 25:
$ money -= 25
bo "good night"
$ day += 1
$ time = 0
call updatestats from _call_updatestats15
jump mainMenu
if money >= 24:
bo "you cant afford it!"
jump mainMenu
I not have the full code to figure what could be the problem, but think to check the variables...when you are in the menu that causes the problem, clic "shift + o" and then write "day", if the returned value isn't 20 you have a value problem, if value is 20 then the problem is in the conditionals or some other code problem.took me a while to fix some problems.
and yes i invested more work as it was necessary, but im getting better with it.
+=0 was garbage
if i try to rent a room with 0 coins:
"if money == 0" without this line the game throws me back to the main menu
but why won't the day == 20 to work as supposed
is it because im in a menu if this event should happen?
##### Python Functions
init python:
#### Removes 'actions' from the pool a player has
def worldfunction_ConsumeActionPoints(consumed):
store.worldstat_ActionsLeft -= consumed
if store.worldstat_ActionsLeft < 1:
internalfunction_AdvanceDay()
#### called when the variable monitor the amount of actions you have is 0 or less.
def internalfunction_AdvanceDay():
store.worldstat_CurrentDay += 1
store.worldstat_ActionsLeft = store.worldstat_ActionsMaximum
if store.worldstat_CurrentDay > 7:
internalfunction_AdvanceWeek()
else:
renpy.jump("worldlabel_NewDayBegins")
#### This label is called every day when you run out of 'actions'... time essentially
label worldlabel_NewDayBegins:
$ uidisplay_WhichBackgroundIsShowing = "base"
$ worldfunction_UpdateCurrentDate()
$ systemfunction_DifficultyUpdate()
$ uidisplay_WhichBackgroundIsShowing = 1
$ quick_menu = False
$ store.rpgstat_PlayerCurrentHealthPool = store.rpgstat_PlayerMaximumHealthPool
$ uifunction_CustomNotification("You had to return home to rest, a new day begins.")
if freia.characterstat_CurrentQuestStage == 10000:
if "hscene_Freia_02" not in freia.characterstat_LabelsOfSexScenesForMemories:
jump hscene_Freia_02
jump locationlabel_MainEncampment
### The Hub before you explore the world
label locationlabel_MainEncampment:
$ quick_menu = False
$ systemfunction_MapMusic()
$ locationsystem_CurrentLocation = "locationlabel_MainEncampment"
call screen screenlabel_BaseNavigation
label somestoryelement01:
### SOME STUFF HAPPENED HERE ###
$ worldfunction_ConsumeActionPoints(X Amount of Points)
elif result == "bar":
scene table1
play music "<loop 6.333>sfx/bar.mp3"
menu mainMenu:
"Work 1 shift":
if time <= 0:
"it's to early to work"
jump mainMenu
elif time >= 3:
"Bar is closed"
jump mainMenu
elif time >=0:
scene table1
$ time +=1
$ money += 30
call updatestats from _call_updatestats_9
"you earned 30 coins"
jump mainMenu
"Have a drink":
menu:
"Pay 5 coins?"
"yes":
if time >= 3:
c "Bar is closed"
jump mainMenu
elif money >=5:
$ money -= 5
bo "here your drink"
c "arg, the good strong stuff"
$ time += 1
call updatestats from _call_updatestats8
jump mainMenu
elif money <=4:
$ money +=0
bo "you cant afford it!"
jump mainMenu
"no":
jump mainMenu
"Rent a Room":
menu:
if day == 20:
jump map
else:
"Pay 25 coins?"
"yes":
if money >= 25:
$ money -= 25
bo "good night"
$ day += 1
$ time = 0
call updatestats from _call_updatestats15
jump mainMenu
if money >= 24:
bo "you cant afford it!"
jump mainMenu
"no":
jump mainMenu
"Back":
stop music
jump map
Try changing this part:i use now your code in it (mgomez0077)
right now there is a minor problem with the menu because the line "if day == 20:" expect a menuitem.
"Rent a Room":
if day == 20:
jump map
else:
menu:
"Pay 25 coins?"
"yes":
if money >= 25:
$ money -= 25
bo "good night"
$ day += 1
$ time = 0
call updatestats from _call_updatestats15
jump mainMenu
if money >= 24:
bo "you cant afford it!"
jump mainMenu
"no":
jump mainMenu
Then put "if day == 21 and time == 3:" wherever you needbtw i need a diffrent place to get this code running.
here it will only works while i sleep and set time to 1, but if i want to occur it day 21 time 3 don't even now what im doing at this time
Well, you can put conditional where you need, for example:if i use it before rent a room it won't be possible to sleep that day at all.
well, i could jump to an event and end the day in it..
i'll do it like that for now...
thanks for helping me so much!
another question.. i use this code, can i add a color function in here?
textbutton "Inventory" action ToggleScreenVariable("show_inv", True, False)
"Rent a Room":
menu:
"Pay 25 coins?"
"yes":
if money >= 25:
$ money -= 25
bo "good night"
$ day += 1
$ time = 0
if day == 20: ## You can put conditional here
jump map
call updatestats from _call_updatestats15
jump mainMenu
if money >= 24:
bo "you cant afford it!"
jump mainMenu
"no":
jump mainMenu
textbutton "{color=#ffffff}Inventory{/color}" action ToggleScreenVariable("show_inv", True, False)
Some words about the construction of condition structures.Code:[...] "yes": if money >= 25: [...] jump mainMenu if money >= 24: [...] jump mainMenu
if condition1:
[...]
"it was condition 1"
jump somewhereElse # beak the actual flow
if condition2:
[...]
"it was condition 2"
call anotherPart # quit the actual flow, but will return to it
if condition3:
[...]
"it was condition 3"
return # break the actual flow by returning to the previous one.
"yes":
if money >= 25:
"You can afford it"
elif money >= 20:
"Almost there, but you're still short of few bucks."
elif money == 0:
"Man, you're totally broke, stop dreaming."
else:
"You haven't enough money."
jump mainMenu
if day == something:
do something
if day >= something and flagForThisEvent is False:
do something
default storyArc = 0
label something:
if storyArc == 0 and day >= 5:
[first event]
storyArc += 1
elif storyArc == 1 and day >= 7:
[second event]
storyArc += 1
[...]
else:
[nothing more for now]
You're welcome, and don't hesitate if you've more questions in the future. Whatever it's me or someone else, there's many people willing to help here.@You must be registered to see the linkssince i can't thank you twice...thanks again im going to study you post #34 now
default storyArc = 0
label something:
if storyArc == 0 and day >= 5:
[first event]
storyArc += 1
default storyArc = 0
label something:
if storyArc == 0 and day >= 5 and variablex >=6:
$ storyArc += 1
jump event
label park:
scene park
menu:
"walk around":
$ time += 1
"jump in the water":
[whatever]
BUT HOW DO I GET HERE:
label something:
if storyArc == 0 and day >= 5 and variablex >=4: