• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Question - Code Script firing twice

M

minibigs

Guest
I've just started using GM2 today after a year or so of not using it.

GM2 updated tself to 4.3.0 20.19.15.4835 level.

As a start to re-familiarising myself I decided to write a simple tile based game & immediately hit an issue where scripts seem to fire more than once.

To investigate, I shut my Windows PC down & reloaded it so nothing is left in storage, started GM2 afresh &
wrote simlified code as follows:


Object with a create event script of 2 lines:

---------------------------------------------------------------------------------

show_message("In Create")
script_execute(TestScript())

---------------------------------------------------------------------------------

I checked only 1 instance of this object is attached to the room.

Called script TestScript:

---------------------------------------------------------------------------------

show_message("in TestScript")

---------------------------------------------------------------------------------



Resulting output is:
Message "In Create" appears in a pop up. I OK it.

Message "In TestScript" appears in a pop up. I OK it.

Now a fresh copy of the message "In TestScript" pops up.
 
Top