Skip to main content

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

Help with procedure command

A topic by crt_future1 created Jul 28, 2024 Views: 227 Replies: 6
Viewing posts 1 to 2

I'm having a good time with this engine. However, I think I am using the procedure command wrong.

Trying to run the following in a terminal:

image Button /Sprites/Ammo/buttontest.png

button Button 500 300 test

procedure test

text "Hello World!"

end

I'm attempting to get a button to load a procedure, as per the manual. However, the button command won't load when I have the procedure code in the script -- the event simple freezes. When the procedure code is absent, the button loads, but when activated it of course doesn't load anything and crashes the game. Is the code for the procedure meant to be in a separate script file, or I am simply missing something? Help would be appreciated.

(+1)

Procedure should be written at the very beginning. And only the rest after "end".

Ah, thanks for the reply. That got the button working, but once it is activated, it crashes when it tries to load the procedure.

procedure test

text "Hello World!"

end

cursor 1

image TestButton /Sprites/Ammo/buttontest.png

button TestButton 500 300 test

Any ideas?

(+1)

Add "map return" before "end".

I gave it a try. It still crashes. It seems when the button is pressed, it fails to load the procedure and just crashes.

(+1)

I think it is necessary to stop the script after pressing the button. Add "halt" after the button line.

That worked! Thanks for the help.