Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Not working in Script

A topic by castorpollux_285 created Jul 25, 2023 Views: 280 Replies: 6
Viewing posts 1 to 6
(1 edit)

Hello,

it is not working when I change something in this script. There are also no messages in the server window when I save the file. Other scripts and events work fine.

// Script assets have changed for v2.3.0 see
// <a href="https://help.yoyogames.com/hc/en-us/articles/360005277377">https://help.yoyogames.com/hc/en-us/articles/360005277377</a> for more information
function scr_anzeigegeraet_screen(breite,hoehe,screen){
// GMLive
if (live_call(breite,hoehe,screen)) return live_result;
draw_text(obj_astronaut.x,obj_astronaut.y-100,string(breite))
draw_text(obj_astronaut.x,obj_astronaut.y-20,string(hoehe))
draw_text(obj_astronaut.x,obj_astronaut.y-10,string(screen))
// Wenn Arm oben ist, anzeigen
if (global.arm_oben = true)
{
// Arm x und y
var _arm_x = obj_arm.x
var _arm_y = obj_arm.y
// Hausmenu Größe
if (screen = "haus_menu")
{
// Maße
menu_breite = breite
info_breite = 50
gesamt_breite = 180 //innen_abstand + menu_breite + innen_abstand + 1 + innen_abstand + info_breite + innen_abstand
gesamt_hoehe = hoehe
}
//var _halbe_breite = breite / 2
// Strahl zeichnen ********************
// Transparenz einstellen
//var _strahl_alpha = global.anzeigegeraet_transparenz - random_range(0.1,0.3)
var _strahl_alpha = global.anzeigegeraet_transparenz // - 0.3
//draw_set_alpha(global.anzeigegeraet_strahl_transparenz)
//draw_set_alpha(global.anzeigegeraet_transparenz)
var _dreieck_groesse = (gesamt_breite - (10 * 2)) / 2
//var _dreieck_hoehe = 30
var _strahl_farbe = global.farbe_screen_ganz_hell
// Glitch starten
//scr_glitch_start()
draw_set_alpha(0.3)
// Linkes Dreieck zeichnen
draw_triangle_color(_arm_x,_arm_y, _arm_x - _dreieck_groesse, _arm_y - _dreieck_groesse, _arm_x, _arm_y - _dreieck_groesse, _strahl_farbe, _strahl_farbe, _strahl_farbe,false)
// Rechtes Dreieck zeichnen
draw_triangle_color(_arm_x,_arm_y, _arm_x + _dreieck_groesse , _arm_y - _dreieck_groesse, _arm_x, _arm_y - _dreieck_groesse, _strahl_farbe, _strahl_farbe, _strahl_farbe,false)
draw_set_alpha(1)
// Flackern *******************************
/*
if !variable_instance_exists(id,"eben_zahl")
{
eben_zahl = 0
}
eben_zahl += 1
// Farbe
var _flackern_farbe = global.farbe_screen_ganz_hell
draw_set_alpha(0.5)
// Random Werte
var _gesamtbreite = random_range(3,20)
var _x_abstand = random_range(0,_dreieck_groesse-_gesamtbreite)
draw_triangle_color(_arm_x,_arm_y, _arm_x + _x_abstand, _arm_y - _dreieck_groesse, _arm_x + _x_abstand + _gesamtbreite, _arm_y - _dreieck_groesse, _flackern_farbe, _flackern_farbe, _flackern_farbe,false)
// Links
// Random Werte
var _gesamtbreite = random_range(3,20)
var _x_abstand = random_range(0,_dreieck_groesse-_gesamtbreite)
draw_triangle_color(_arm_x,_arm_y, _arm_x - _x_abstand, _arm_y - _dreieck_groesse, _arm_x - _x_abstand - _gesamtbreite, _arm_y - _dreieck_groesse, _flackern_farbe, _flackern_farbe, _flackern_farbe,false)
draw_set_alpha(1)
*/
// Screen zeichnen
var _screen_breite = gesamt_breite / 100
var _screen_hoehe = gesamt_hoehe / 100
// Hintergrund zeichnen
draw_sprite_ext(spr_screen_hintergrund_linien, 0, _arm_x, _arm_y - _dreieck_groesse + 2, _screen_breite, _screen_hoehe, 0, global.farbe_screen_ganz_hell, global.anzeigegeraet_transparenz)
// Transparenz zurücksetzen
draw_set_alpha(1)
// Glitch beenden
//scr_glitch_end()
// Variablen Rand des Screens
screen_links = obj_arm.x - (gesamt_breite / 2)
screen_unten = obj_arm.y - _dreieck_groesse
screen_rechts = screen_links + gesamt_breite
screen_oben = screen_unten - gesamt_hoehe
screen_mitte = screen_links + (gesamt_breite / 2)
// Screen Ecken zeichnen
var _ecken_farbe = global.farbe_screen_dunkel
// Oben Links
draw_sprite_ext(spr_screen_ecke_oben_links,0,screen_links,screen_oben + 2,1,1,0,_ecken_farbe,1)
// Oben Rechts
draw_sprite_ext(spr_screen_ecke_oben_rechts,0,screen_rechts,screen_oben  + 2,1,1,0,_ecken_farbe,1)
// Unten Links
draw_sprite_ext(spr_screen_ecke_unten_links,0,screen_links,screen_unten  + 2,1,1,0,_ecken_farbe,1)
// Unten rechts
draw_sprite_ext(spr_screen_ecke_unten_rechts,0,screen_rechts,screen_unten  + 2,1,1,0,_ecken_farbe,1)
}
}
Developer

What about the Output in the editor? And are you using the most recent version? There were a couple fixes a month and some ago.

There is nothing in the Output either. I installed it on monday from the marketplace. Game Maker Version is IDE v2023.6.0.89 Runtime v2023.6.0.137.

Developer

Is there a possibility that you can trim this script down a little to figure out what portion of it causes it to not work with GMLive? There’s a good amount of resources and variables in here.

That would most likely cost more time than it saves... Then I would rather not use GMLive with this script.

Do I have to pay attention at global variables? I have noticed in another script that the use of global variables may cause problems.

Developer

Removing ~half of the code to check if that makes it compile (even if it will error afterwards) a few times wouldn’t take too much. Perhaps also watch if the server window says “updated (script name)” and what the Output window says / add screenshots of these.

Global variables should be fine; there might be some way to break globalvar detection if you don’t use semicolons or find a novel way to write the declaration that I’m not aware of (e.g. the extension used to have problems with var var i;). I think the most notable issue right now is that trying to live-update a constructor doesn’t work very well, only methods inside it.

In the meantime I finshed working on this script.

Thanks for your support!