Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

add_options not working

A topic by roli7 created Apr 02, 2025 Views: 77 Replies: 5
Viewing posts 1 to 6

Hi,

I love the engine but i havent seen any detailed documentation about different options.

For me its not working:

if (global.healthscore <= 0 && !global.game_over) {
   global.game_over = true;
       alarm[0] = room_speed * 3; 
textbox_create("YOU LOST!!!!!!");
textbox_set("??????",c_black,c_red,#BCB067,1,example_font,angelspriteportrait,true,example_continue1,35,true);
textbox_add_options(c_red,1,"Cool!","Not good.","Do you have pets?");
textbox_change_message_according_option(2,
"Yes it is!",
"It is cool! You... you just don't understand...",
"Yes I have a cat. Wait... How is that related to this?");
}

I dont see the options just like in the demo file!

Also the text starts too high.

https://imgur.com/a/8oMcWoV

Developer

Hi,

There are some problems with your code, here are some tips:

  1. Use if (!textbox_exists()) { } to make sure the textbox code runs only once.
  2. With textbox_add_options, you are setting the options to appear with message 1. But the first message is 0, so change it to that.
  3. With textbox_change_message_according_option, you are trying to change the message 2 (in other words, third message). But with textbox_create you have set only one message/text, so it will not change anything.

So try changing these things, and see if it works then. I will try to improve the documentation of this.

Developer

Also I’m not sure why the text is so up there, maybe you are using draw_set_valign somewhere? In that case, after using it, try setting it back to fa_top.

If that is not it, then you can always change the position of everything, including text, using textbox_set_position.

(2 edits)

Hi,

https://imgur.com/a/tyAdBNz

Thank you so much. I will try.

I have another issue with bubbles. Every time its so far from the object.

Step event: 

if (!played) {
if (hatman.visible==true) {
if !textbox_exists() {
 
textbox_create(text[0]);
textbox_set_bubble(noone,c_white,c_black,1,example_font,23,bubble_width,id);
played=true;
}
} }

Create:


// You can write your code in this editor
/// @description Variables
image_speed = 0;
text[0] = "";
bubble_width = 150;
played=false;


Creation code: 

bubble_width = 230;
text[0] = "Hey little one, come here!";


Developer (1 edit)

That speech bubble thing seems to be a rare bug that only happens in some projects. I have never been able to reproduce it, so it has been difficult to fix. Could you send me your project with email so I can find the reason for this? (pikkua.games at gmail.com)

Alternatively, try changing some settings in your game, like the room, view or camera size and aspect ratio to see if it has any effect. If you manage to figure it out, let me know how.

Edit: The next update (2.9.0) will have a fix for the rare speech bubble bug.