• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

not working, gived all the best

Code:
if string_length(text) > last_space{
    DialogueON = 1;
    with(obj){
        talking = 1;
    }
    show_debug_message("Lalalala443");
}else if string_length(text) <= last_space{
    with(obj){
        talking = 0;
        show_debug_message("Lalalala");
    }
    DialogueON = 0;
}
And I tried obj.talking = 1...

the code is perfect(even dialogueON, is good) is showing the debug message... but the talking value at my obj not changing....
 
Last edited:

jo-thijs

Member
Well, there's nothing wrong with this code, so some other code must be resetting the values.
Can you provide us with more code?
 
Oh, I leaved the warm of bed for this :p

p.s:Double post because I think jo-thijs have watching the thread checked
Scripts:
-scr_text:
Code:
txt = instance_create(1, 1, obj_text);

with(obj_text){
    wrspd = argument0;
    spr = argument1;
    font = argument2;
    sound = argument3;
    text = argument4;
    obj = argument5;
}
step in the argumented obj:
Code:
if global.killedtm = 1{
    sprite_index = spr_TemmiD;
    image_speed = 0;
}if global.killedtm = 0{
    if instance_exists(obj_text){
        if talking = 1 && obj_text.dialogueON = 1{
            sprite_index = spr_TemmiNM;
            image_speed = 0.5;
            show_debug_message(string(talking)+"rtgdfgfdgrfdtgAurel");
            }else if talking = 0 && obj_text.dialogueON = 0{
            show_debug_message(string(talking)+"rtgdfgfdgrfdtgGeorgel");
            sprite_index = spr_TemmiN;
            image_speed = 0.5;
        }
        show_debug_message(string(obj_text.dialogueON)+"rtgdfgfdgrfdtg");
    }
    if instance_exists(obj_textcol1){
        if talking = 1 && obj_textcol1.dialogueON = 1{
            sprite_index = spr_TemmiNM;
            image_speed = 0.5;
        }else if talking = 0 && obj_textcol1.dialogueON = 0{
            sprite_index = spr_TemmiN;
            image_speed = 0.5;
        }
    }
}
create :
Code:
image_speed = 0.1;
talking = 0;
 

jo-thijs

Member
p.s:Double post because I think jo-thijs have watching the thread checked
I have not actually, though I don't see how that would change anything.

As for the code you posted, I still can't see anything wrong.
Perhaps yet some other code?
Could you give us the object information (text that appears when you click on "object information" when editing an object) of all the relevant objects?
 
Code:
Information about object: obj_Temmi
Sprite: spr_TemmiN
Solid: true
Visible: true
Depth: 0
Persistent: false
Parent:
Children:
Mask:

No Physics Object
Create Event:

execute code:

image_speed = 0.1;
talking = 0;

Step Event:

execute code:

if global.killedtm = 1{
    sprite_index = spr_TemmiD;
    image_speed = 0;
}if global.killedtm = 0{
    if instance_exists(obj_text){
        if talking = 1 && obj_text.dialogueON = 1{
            sprite_index = spr_TemmiNM;
            image_speed = 0.5;
            show_debug_message(string(talking)+"rtgdfgfdgrfdtg");
            }else if talking = 0 && obj_text.dialogueON = 0{
            show_debug_message(string(talking)+"rtgdfgfdgrfdtg");
            sprite_index = spr_TemmiN;
            image_speed = 0.5;
        }
        show_debug_message(string(obj_text.dialogueON)+"rtgdfgfdgrfdtg");
    }
    if instance_exists(obj_textcol1){
        if talking = 1 && obj_textcol1.dialogueON = 1{
            sprite_index = spr_TemmiNM;
            image_speed = 0.5;
        }else if talking = 0 && obj_textcol1.dialogueON = 0{
            sprite_index = spr_TemmiN;
            image_speed = 0.5;
        }
    }
}

Other Event: Room Start:

execute code:

if global.killedtm = 1{
    instance_destroy();
    audio_stop_sound(sd_YourOnlyFriend);
}
I saw not the talking was the problem, the real problem was DialogueON, but still not solved, I tried to use globals for this, but was point less




Solved(by removing dialogueON, and make working only talking)... but still I want why that doesnt work(mean to the DialogueON...?
 
Last edited:

jo-thijs

Member
You probably did set it before reading, you initialized it in a create event.
However, the first code you posted doesn't change that variable, but just sets an other variable.
 
Top