menu problem and point system problem

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
texasstallion
Regular
Posts: 33
Joined: Tue Jun 27, 2017 4:11 pm
Contact:

menu problem and point system problem

#1 Post by texasstallion »

Ok im trying to make a date sim, i was first going about it as a just a visual novel, since i didn't now how to make a date sim, but now i kinda understand how to make it into a date sim. But now i am facing two problems one my point system is not working anymore, and the other is that i want my town menu to go away after i use it i tried to add hide screen town but it didn't work. thanks for the help in advance. here is my script i know its kinda crappy right now but i was just trying to get the first day up and then really work out the dialogue and everything else.

define mc = Character("michael")
define sis = Character("janice")
define mom = Character("roxane")
define f1 = Character("nick")
define f2 = Character("chan")
define f3 = Character("barry")
define f4 = Character("dave")
define g1 = Character("sarah")
define g2 = Character("marry")
define g3 = Character("beth")
define g4 = Character("elizbeth")
define e1 = Character("john")
define e2 = Character("damion")
define e3 = Character("greg")
define w1 = Character("Randolph") # hobbies anime and comics can be seen in comic store in later scenes
define w2 = Character("ms.Burner")
define w3 = Character("ms.Hyattr")
define w4 = Character("ms.Barrant")
define w5 = Character("ms.stone") #
define w6 = Character("Ms.Flemming.")
define t1 = Character("ms.johnson") # hobbies anime and comics can be seen in comic store in later scenes
define t2 = Character("ms.jones")
define t3 = Character("ms.parker")
define t4 = Character("ms.hernandez")
define t5 = Character("ms.stone") #
define t6 = Character("ms.kelly")







# The game starts here.
label start:

$ c_point = 0
$ sp_point = 0
$ st_point = 0
$ f1_point = 0
$ f2_point = 0
$ f3_point = 0
$ f4_point= 0
$ sis_point = 0
$ mom_point = 0
$ g1_point = 0
$ g2_point = 0
$ g3_point = 0
$ g4_point = 0
$ g5_point = 0
$ e1_point = 0
$ e2_point = 0
$ e3_point = 0
$ e4_point = 0
$ tg1_point = 0
$ tg2_point = 0
$ tg3_point = 0
$ tg4_point = 0

$ hist_point = 0
$ sci_point = 0
$ eng_point = 0
$ math_point = 0
$auto_point= 0
$ comp_point = 0

$ music_point = 0
$ dexterity_point = 0
$ confience_point = 0
$ strength_point = 0
$ stamina_point = 0
$ charisma_point = 0
$ fighting_point = 0
$ day_point = 0

# Show a background. This uses a placeholder by default, but you can
# add a file (named either "bg room.png" or "bg room.jpg") to the
# images directory to show it.
image bg scienceclass = "classroom1r.jpg"
image bg historyclass = "classroom2.jpg"
image bg mathclass = "classroom3.jpg"
image bg englishclass = "classroom4.jpg"
image bg computerclass = "computeroom1.jpg"
image bg sky1 = "sky1r.jpg"
image bg housefront1 = "housefront1.jpg"

label town:
screen navigation():

imagemap:
ground "town1-ground.jpg"
hover "town1-hover.jpg"
idle "town1-idle.jpg"
hotspot (365, 693, 485, 25) clicked Jump("park")
hotspot (55, 25, 155, 155) clicked Jump("policestation")
hotspot (749, 17, 155, 155) clicked Jump("mall")
hotspot (47, 281, 155, 155) clicked Jump("gym")
hotspot (53, 503, 155, 155) clicked Jump("cityhall")
hotspot (525, 15, 155, 155) clicked Jump("hospital")
hotspot (1055, 25, 203, 215) clicked Jump("school")
hotspot (280, 25, 155, 155) clicked Jump("church")
hotspot (1025, 561, 54, 54) clicked Jump("mchouse")
hotspot (354, 285, 130, 81) clicked Jump("arcade")
hotspot (783, 286, 130, 81) clicked Jump("resturant")
hotspot (566, 286, 130, 81) clicked Jump("library")

# The game starts here.


label day1:
scene bg sky1r

"First day of school."
"looks at the alarm the "

scene bg housefront1
label fronthouse1:

mc "I better get up and get ready for school"
"leaves the house and walks toward school"
f1 " Hey Micheal do you want to walk to school together "
menu:
"yeah sure":
$ f1_point += 1
jump yeahsure
"no i want to walk by myself":
jump noibymyself
label yeahsure:
f1 "first day of school are you ready"
mc " yeah i'm ready I hope we have a good year "
e1 " damn nick did you get even fatter during summer "
menu:
"hey dont talk about nick":
$ f1_point += 2
jump goodfriend
"go eat a dick john":
$ f1_point += 4
$ e1_point -= 2
jump goodfriend
"say nothing":
jump saynothingbyself

label saynothing:
" they walk to school in aqward silence "
label noibymyself:
"walks by self to school"
e1 " damn nick did you get even fatter during summer "
menu:
"hey dont talk about nick" :
$ f1_point += 2
jump goodfriend
"He is beyond fat he is obesite" :
$ f1_point -= 2
$ e1_point += 2
jump meanfriend
"say nothing" :
jump saynothingbyself
label meanfriend:
e1"yo"
mc"sup"
"continues to walk to school"
jump school1

label goodfriend:
f1"thanks for that"
mc"No problem"
jump school1

label saynothingbyself:
jump school1

label school1:
"mike gose to school eat breaksfest and hangsout"
menu:
"go to 1st class":
$ auto_point += 3
$ f1_point += 3
$ g1_point += 3
jump auto
"skip ":
$ charisma_point +=1
$ e2_point += 3
$ e3_point += 3
jump skip1
label skip1:
"hangs out with john and greg"
" yall avoid teacher unil the next period bell rings"
menu:
"go to 2nd class":
$ math_point += 3
$ f2_point += 3
$ g2_point += 3
jump science
"skip agian":
$ charisma_point +=1
$ e2_point += 3
$ e3_point += 3
jump skip2
label auto:

"its the first day of school an everyone is nervouse and exitedited "
"Automotive is mike first class, which he has with nick,"
"Mike goes to the seat with his name to it, it iss right behind nick."
"mike listen and take part in class untill the bell rings"
menu:
"go to 2nd class":
$ math_point += 3
$ f2_point += 3
$ g2_point += 3
jump science
"skip ":
$ charisma_point +=1
$ e2_point += 3
$ e3_point += 3
jump skip2
label skip2:
"hangs out with john and greg"
" yall avoid teacher unil the next period bell rings"
menu:
"go to 3rd class":
$ math_point += 3
$ f2_point += 3
$ g2_point += 3
jump science
"skip agian":
$ charisma_point +=1
$ e2_point += 3
$ e3_point += 3
jump skip3
label science:
scene bg scienceclass

"Mike gose to the seat with his name to it, it is right behind a cute girl."
"you listen and take part in class untill the bell rings"

menu:
"go to 3rd class":
$ math_point += 3
jump math
"skip class":
$ charisma_point +=1
$ e2_point += 3
$ e3_point += 3
label skip3:
"hangs out with john and greg"
" yall avoid teacher unil the next period bell rings"
menu:
"go to luch":
jump lunch
# "go to luch off campus ":
# jump
label math:

"Mike gose to the seat with his name to it, it is right behind a cute girl."
"you listen and take part in class untill the bell rings"

menu:
"go to lunch class":
jump lunch

label lunch:

"joseph looks for a somewhere to sit he see nick."
"when the bell rings for lunch they part ways and mike gose to his next class"
menu:
"go to 4th class":
$ eng_point += 3
jump english

label english:

"Mike gose to the seat with his name to it, it is right behind a cute girl."
"you listen and take part in class untill the bell rings"

menu:
"go to 5th class":
$ comp_point += 3
jump computer

label computer:

"Mike gose to the seat with his name to it, it is right behind a cute girl."
"you listen and take part in class untill the bell rings"
menu:
"Its finnaly time to go home micheal grabs his bag and exits the school":
jump leavingschool

label leavingschool:

"Mike gose to the seat with his name to it, it is right behind a cute girl."
"you listen and take part in class untill the bell rings"

menu:
"go home":
jump donewithschool1

label donewithschool1:

"mike decides where he should go after school "

menu:
"stay and go to the auto club ":
$ auto_point += 3
jump autoclub
"stay and go to the computer club ":
$ comp_point += 3
jump computerclub
"stay and go to the musicclub ":
$ music_point += 3
jump musicclub
"stay and go to the football practice ":
$ strength_point += 2
$ stamina_point += 1
jump footballteam
"stay and go to the basketball practice ":
$ strength_point += 1
$ stamina_point += 2
jump basketballteam

label autoclub:
"mike gose to autoclub and joinst "
"mike sees nick and you talk about cars and streetracing "
"also meets beth yall talk about cars"
$ f1_point += 3
$ g1_point += 3

menu:
"gose home":
jump donewithscchool2


label computerclub:
"mike tryout for the football team and barley makes it "
"you meets barry and you paractice toegther "
"also meets beth she is a cheerleader who like to watch the guys play footballball after she practice"
$ f2_point += 3
$ g2_point += 3
menu:
"gose home":
jump donewithschool2


label musicclub:
"mike gose to musicclub and join "
"mike meets chan and you talk about music "
"also meets beth yall talk about music"
$ f3_point += 3
$ g3_point += 3
menu:
"gose home":
jump town


label footballteam:
"mike tryout for the football team and barley makes it "
"you meets barry and you paractice toegther "
"also meets beth she is a cheerleader who like to watch the guys play footballball after she practice"
$ f3_point += 3
$ g3_point += 3
menu:
"gose home":
jump mchouse


label basketballteam:
"mike tryout for the basketball team and barley makes it "
"you meets dave and you paractice toegther "
"also meets elizbeth she is a cheerleader who like to watch the guys play baskterball after she practice"
$ f4_point += 3
$ g4_point += 3
menu:
"gose home":
jump mchouse



label arcade:
"at the arcade"
label park:
scene bg park1
"you go to the park"
label beach:
"at the beach"
label mall:
"at the mall"
label policestation:
"at the police station"
label hospital:
"you have arived"
label church:
"you have arived"
label mchouse:
"you have arived"
hide screen navigation
jump day1
label cityhall:
"you have arived"
label resturant:
"you have arived"
label school:
"you are at school"
label gym:
"you have arived"
label library:
"you have arived"

# This ends the game.
return

texasstallion
Regular
Posts: 33
Joined: Tue Jun 27, 2017 4:11 pm
Contact:

Re: menu problem and point system problem

#2 Post by texasstallion »

I'm sorry, but an uncaught exception occurred.

While running game code:
File "game/script.rpy", line 129, in script
$ f1_point += 1
File "game/script.rpy", line 129, in <module>
$ f1_point += 1
NameError: name 'f1_point' is not defined

-- Full Traceback ------------------------------------------------------------

Full traceback:
File "game/script.rpy", line 129, in script
$ f1_point += 1
File "F:\New folder\renpy-6.99.12.4-sdk\renpy\ast.py", line 814, in execute
renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
File "F:\New folder\renpy-6.99.12.4-sdk\renpy\python.py", line 1719, in py_exec_bytecode
exec bytecode in globals, locals
File "game/script.rpy", line 129, in <module>
$ f1_point += 1
NameError: name 'f1_point' is not defined

Windows-7-6.1.7601-SP1
Ren'Py 6.99.12.4.2187
clover saga 1.0

when you hit yeah sure on my menu selection

User avatar
mitoky
Veteran
Posts: 316
Joined: Sat Feb 07, 2015 9:12 pm
Projects: The Purring Demon's Love, circus eterie
Contact:

Re: menu problem and point system problem

#3 Post by mitoky »

First, you should copy the code using the code function here in lemmasoft, otherwise its really hard to tell what could be wrong. (In the Full Editor, the symbol looks like this: "</>")

From the first glance though on the menu, what i think is wrong is this:

Technically you don't have to make the townmap a seperate label.
For it to work, you need to create a screen (since nagivation is taken whem making a game and lets assume you didnt changed that, lets use 'townmap' instead)

Code: Select all

screen townmap():

    modal True
    
    imagemap:
        ground "town1-ground.jpg"
        hover "town1-hover.jpg"
        idle "town1-idle.jpg"

        hotspot (365, 693, 485, 25) action[Jump("park"), Hide("townmap")]
        hotspot (55, 25, 155, 155) action[Jump("policestation"), Hide("townmap")]
        hotspot (749, 17, 155, 155) action[Jump("mall"), Hide("townmap")]
        hotspot (47, 281, 155, 155) action[Jump("gym"), Hide("townmap")]
        hotspot (53, 503, 155, 155) action[Jump("cityhall"), Hide("townmap")]
        hotspot (525, 15, 155, 155) action[Jump("hospital"), Hide("townmap")]
        hotspot (1055, 25, 203, 215) action[Jump("school"), Hide("townmap")]
        hotspot (280, 25, 155, 155) action[Jump("church"), Hide("townmap")]
        hotspot (1025, 561, 54, 54) action[Jump("mchouse"), Hide("townmap")]
        hotspot (354, 285, 130, 81) action[Jump("arcade), Hide("townmap")]
        hotspot (783, 286, 130, 81) action[Jump("resturant"), Hide("townmap")]
        hotspot (566, 286, 130, 81) action[Jump("libary"), Hide("townmap")]
Since your problem is the screen isnt hiding, we add it to the action.
Afterwards you can simply call the screen when needed:

Code: Select all

call screen townmap

texasstallion
Regular
Posts: 33
Joined: Tue Jun 27, 2017 4:11 pm
Contact:

Re: menu problem and point system problem

#4 Post by texasstallion »

You are so awesome thank you a lot

texasstallion
Regular
Posts: 33
Joined: Tue Jun 27, 2017 4:11 pm
Contact:

Re: menu problem and point system problem

#5 Post by texasstallion »

im getting an error while trying to implement new image maps for my game

Code: Select all

screen computerclass1():

    modal True
    
    imagemap:
        ground " computerclass1r-ground.jpg"
        hover "computerclass1r-hover.jpg"
        idle "computerclass1r-idle.jpg"

        hotspot (213, 467, 147, 76) action[Jump("townmap"), Hide("computerclass")]
        
this is the error

Code: Select all

I'm sorry, but an uncaught exception occurred.

While loading <'Image' u' computerclass1r-ground.jpg'>:
  File "game/script.rpy", line 365, in script
    menu:
IOError: Couldn't find file ' computerclass1r-ground.jpg'.

-- Full Traceback ------------------------------------------------------------

Full traceback:
  File "game/script.rpy", line 365, in script
    menu:
  File "E:\New folder\renpy-6.99.12.4-sdk\renpy\ast.py", line 1459, in execute
    choice = renpy.exports.menu(choices, self.set)
  File "E:\New folder\renpy-6.99.12.4-sdk\renpy\exports.py", line 847, in menu
    rv = renpy.store.menu(items)
  File "E:\New folder\renpy-6.99.12.4-sdk\renpy\exports.py", line 1033, in display_menu
    rv = renpy.ui.interact(mouse='menu', type=type, roll_forward=roll_forward)
  File "E:\New folder\renpy-6.99.12.4-sdk\renpy\ui.py", line 285, in interact
    rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
  File "E:\New folder\renpy-6.99.12.4-sdk\renpy\display\core.py", line 2526, in interact
    repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, **kwargs)
  File "E:\New folder\renpy-6.99.12.4-sdk\renpy\display\core.py", line 2883, in interact_core
    self.draw_screen(root_widget, fullscreen_video, (not fullscreen_video) or video_frame_drawn)
  File "E:\New folder\renpy-6.99.12.4-sdk\renpy\display\core.py", line 1955, in draw_screen
    renpy.config.screen_height,
  File "renpy/display/render.pyx", line 427, in renpy.display.render.render_screen (gen\renpy.display.render.c:6806)
    rv = render(root, width, height, 0, 0)
  File "renpy/display/render.pyx", line 196, in renpy.display.render.render (gen\renpy.display.render.c:2978)
    rv = d.render(widtho, heighto, st, at)
  File "E:\New folder\renpy-6.99.12.4-sdk\renpy\display\layout.py", line 693, in render
    surf = render(child, width, height, cst, cat)
  File "renpy/display/render.pyx", line 110, in renpy.display.render.render (gen\renpy.display.render.c:3440)
    cpdef render(d, object widtho, object heighto, double st, double at):
  File "renpy/display/render.pyx", line 196, in renpy.display.render.render (gen\renpy.display.render.c:2978)
    rv = d.render(widtho, heighto, st, at)
  File "E:\New folder\renpy-6.99.12.4-sdk\renpy\display\layout.py", line 693, in render
    surf = render(child, width, height, cst, cat)
  File "renpy/display/render.pyx", line 110, in renpy.display.render.render (gen\renpy.display.render.c:3440)
    cpdef render(d, object widtho, object heighto, double st, double at):
  File "renpy/display/render.pyx", line 196, in renpy.display.render.render (gen\renpy.display.render.c:2978)
    rv = d.render(widtho, heighto, st, at)
  File "E:\New folder\renpy-6.99.12.4-sdk\renpy\display\layout.py", line 693, in render
    surf = render(child, width, height, cst, cat)
  File "renpy/display/render.pyx", line 110, in renpy.display.render.render (gen\renpy.display.render.c:3440)
    cpdef render(d, object widtho, object heighto, double st, double at):
  File "renpy/display/render.pyx", line 196, in renpy.display.render.render (gen\renpy.display.render.c:2978)
    rv = d.render(widtho, heighto, st, at)
  File "E:\New folder\renpy-6.99.12.4-sdk\renpy\display\screen.py", line 623, in render
    child = renpy.display.render.render(self.child, w, h, st, at)
  File "renpy/display/render.pyx", line 110, in renpy.display.render.render (gen\renpy.display.render.c:3440)
    cpdef render(d, object widtho, object heighto, double st, double at):
  File "renpy/display/render.pyx", line 196, in renpy.display.render.render (gen\renpy.display.render.c:2978)
    rv = d.render(widtho, heighto, st, at)
  File "E:\New folder\renpy-6.99.12.4-sdk\renpy\display\layout.py", line 693, in render
    surf = render(child, width, height, cst, cat)
  File "renpy/display/render.pyx", line 110, in renpy.display.render.render (gen\renpy.display.render.c:3440)
    cpdef render(d, object widtho, object heighto, double st, double at):
  File "renpy/display/render.pyx", line 196, in renpy.display.render.render (gen\renpy.display.render.c:2978)
    rv = d.render(widtho, heighto, st, at)
  File "E:\New folder\renpy-6.99.12.4-sdk\renpy\display\layout.py", line 693, in render
    surf = render(child, width, height, cst, cat)
  File "renpy/display/render.pyx", line 110, in renpy.display.render.render (gen\renpy.display.render.c:3440)
    cpdef render(d, object widtho, object heighto, double st, double at):
  File "renpy/display/render.pyx", line 196, in renpy.display.render.render (gen\renpy.display.render.c:2978)
    rv = d.render(widtho, heighto, st, at)
  File "E:\New folder\renpy-6.99.12.4-sdk\renpy\display\im.py", line 473, in render
    im = cache.get(self)
  File "E:\New folder\renpy-6.99.12.4-sdk\renpy\display\im.py", line 200, in get
    surf = image.load()
  File "E:\New folder\renpy-6.99.12.4-sdk\renpy\display\im.py", line 524, in load
    surf = renpy.display.pgrender.load_image(renpy.loader.load(self.filename), self.filename)
  File "E:\New folder\renpy-6.99.12.4-sdk\renpy\loader.py", line 543, in load
    raise IOError("Couldn't find file '%s'." % name)
IOError: Couldn't find file ' computerclass1r-ground.jpg'.

Windows-7-6.1.7601-SP1
Ren'Py 6.99.12.4.2187
clover saga 1.0

I plan to do a lot of image-maps for this game

User avatar
RicharDann
Veteran
Posts: 286
Joined: Thu Aug 31, 2017 11:47 am
Contact:

Re: menu problem and point system problem

#6 Post by RicharDann »

This is only a guess but I think it's because the empty space before the filename, unless the image file in your project is really called that way, judging from the other image names, instead of:

Code: Select all

        ground " computerclass1r-ground.jpg"
It should be:

Code: Select all

        ground "computerclass1r-ground.jpg"
The most important step is always the next one.

texasstallion
Regular
Posts: 33
Joined: Tue Jun 27, 2017 4:11 pm
Contact:

Re: menu problem and point system problem

#7 Post by texasstallion »

Wow thank you, i was pulling out my hair, trying to figure out, what i was doing wrong
.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot]