Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
Game Link: https://shimmersoft.itch.io/re4-otome
Screenshot 1: https://www.dropbox.com/s/jgul3f8evae9nsj/Screenshot%202020-04-05%2015.03.10.png?dl=0
Screenshot 2: https://www.dropbox.com/s/mdj5zjgv0o7hbad/Screenshot%202020-04-05%2015.03.19.png?dl=0
Similar to your imagined setup, there are slots for image buttons that only appear if a condition has been met, and clicking on an image button opens flavor text about the item. I'll describe some of the basic elements for this and you can tell me whether that gets you closer to your vision.
1) How to access: You want a button on your game screen that's connected to role=sleepgame. I've done various posts explaining the feature in detail, so you might search through my post history for more info, but it basically looks like this:
[button name="inventory" role=sleepgame storage=inventory.ks target=*begin x= y= width= height= ]
The idea here is that you'll have a perpetual button that will pause your game and jump to the inventory screen. When using sleepgame, you'll need to start the scene with "clearance" material to clear out any elements from your main game (these will be "restored" when the game awakens). Here's some of what I have in RE4:
[nolog]
[playse storage=misc/inventory_enter.ogg volume="&[f.sfxvolume]" loop=false clear=false buf=5]
[bg storage=all-purpose-bgs/Black-Screen.jpg time=10]
[free_filter]
[stop_keyconfig]
[cm]
[clearfix]
[clearstack]
[er]
#
[layopt layer=1 visible=true]
[freeimage layer=0]
[freeimage layer=1]
[freeimage layer=2]
[freeimage layer=3]
[freeimage layer=4]
To return to your game, you need to have the system jump to a label and put [awakegame] in a tyranoscript block. You'll have to do a similar clearance when leaving the scene so that inventory elements don't remain. Hide/Unhide screen will probably be useful to you here.
2) For clicking items, I have a) an in-game variable representing each item and b) a variable specifically for "inventory choice" (to indicate which one the user wants to see). To make an item show, each one gets an if statement:
[if exp="f.inv_note==1"]
[image name="note" storage=default/inventory/note.jpg x=57 y=283 width=70 height=70 time=0 layer=0 visible=true]
[else]
[endif]
Where the image for the item is shown if the variable is 1, and nothing otherwise.
[will finish the post later]
I looked at this previous post:
https://steamcommunity.com/app/345370/discussions/1/2944710017716954005/
to try and figure out the sleep/awake game functions a bit more, but am failing drastically.
You're probably going to need code, 'cause you need to tie role=sleepgame to that button directly. E.g., [button name="inventory" role=sleepgame storage=scene.ks target=*label x= y= width= height= ...]
This button should be brought in early on in your scene and since it's a "fix" layer button, it will remain on screen until it's removed by [clearfix].
Once the button is set to jump, you should be able to use hide/unhide to sweep away elements and introduce new ones. Once we get to that point, I'll assist further. One step at a time!
[button name="inventory" graphic="log.png" role=sleepgame storage=inventory.ks target=*FIRST x=45 y=45 width=300 height=350]
I then used the hide function to put up my base inventory screen without any items on it, but can't make any images appear on top of it. I'm guessing that's an issue of needing the layopt layer and freeimage layers you mention in your first post. Are the freeimage layers meant to represent each item while the layopt layer initially hides them all before the variable is activated?
Think of the hide function like a theatrical curtain - it exists for you to set the scene away from the audience's eyes, but you have to eventually pull back the curtain. So you need to use Unhide Screen once you've placed your elements.
To clarify, all of those tags I listed as an example are for "clearance" - basically to eliminate any elements that might be on screen when sleepgame is activated. Remember with sleepgame that the game is "paused" so you can basically clear all graphics in preparation for a new scene. But once you get rid of everything, then you have to lay down the new material. That's where this gets a little trickier and you need to plan around a few questions:
1) Are items collected in a linear, predictable order or is it variable based on player choice?
2) Does each item need to have some "flavor" text when clicked on?
3) Do all items appear on a single page or do you want separate "pages" (which will involve some jumps)?
So in RE4, for instance, I made life a little easier on myself by just assigning single items to particular boxes, so that it wouldn't matter what order they were picked up in. As you've seen, I also concentrated them on a single page to minimize jumps and items can be clicked on for flavor text. But there are other ways to do this, so you'll want to sketch out how you want yours to look.
Regardless of how you proceed, you'll still need a couple of things:
1) A variable attached to each item, which will be used to signal that it's in your inventory
2) A variable attached to the choice being made within your inventory. So in RE4, I have a bunch of [if] statements like these that correspond to flavor text:
[elsif exp="f.inv_choice==2"]
[image name="item_big" storage=default/inventory/herb-green.jpg x=530 y=125 width=130 height=130 time=0 layer=0 visible=true]
[mtext text="Green Plant" x=660 y=175 face=lucky_typewriter color=0xfb5ce3 size=30 in_effect=pulse fadeout=false layer=1 time=500 wait=false]
Some kind of green plant. I have a suspicion that it's marijuana, but I don't know anything about drugs! Really!
Each box also has an invisible button over the top of it that's used to click on the item and bring up the flavor text. Each button evaluates a variable "inv_choice" to a certain number, so that it activates the proper [if] statement. That looks like this:
[if exp="f.inv_herbgreen==1"]
[button name="slot2" fix=true graphic=button/menu/info-d.png enterimg=button/menu/info-h.png clickimg=button/menu/info-c.png x=165 y=51 width=70 height=70 exp="f.inv_choice=2" target=*start enterse=misc/inventory_hover.ogg]
[else]
[endif]
The exp="f.inv_choice=2" part is the variable being set to 2, which triggers the flavor text. The "f.inv_herbgreen" is the item's variable, and the [if] statement basically says "if this item has been set to 1 i.e., picked up, then show this button; otherwise, show nothing".
That's more than you probably need to know at this stage; I just want to give you some forewarning about future steps. For now, what you want to do is:
1) Sketch out your desired layout
2) Tinker with just placing graphics
3) Create variables for each inventory item and a variable for "inventory choice"
Once you get those done, you might share your desired layout and I can advise further. Let me know if you have any questions!