View Issue Details

IDProjectCategoryView StatusLast Update
0028369RunnerFunctionsPublic2021-07-30 14:59
ReporterStewart BishopAssigned ToCoreTech 
PriorityLowSeverityC - GeneralReproducibility100%
Status ResolvedResolutionSuspended 
Product Version 
Target VersionFixed in Version 
Summary0028369: Functions: copying a room with room_assign(destination, source), objects in the destination run their step before create event
DescriptionWhen copying a room with room_assign(destination, source), the objects in the destination room run their step event without running the create event, which can produce errors. This step event trigger happens as soon as room_assign is called, not when the game goes to the destination room, and so objects can run code even if they aren't in the current room.

To reproduce:
Run the attached example. The obj_room_manager should a new room in the create event, then calls room_assign with the template room as the source, and waits 30 steps before going to that new room. The template room has a player object, which should be copied over to the new room.

The expected result is that the room is created, and 30 steps later the game switches to the new room, where you can control the player.

The actual result is that as soon as the game is created, an error is thrown because a variable referenced in the player's step event (created in the player's create event) is not defined.
Steps To Reproduce1) Run the sample
Tagsfunctions, Runner
1.4 Found In1.4.17
2.x Runtime Found In2.1.2.172
2.x Runtime Verified In


Stewart Bishop

2017-11-20 15:49


room_assign_bug.yyz (17,879 bytes)


2021-07-30 14:59

Developer   ~0066558

Issue already present in Jira. [http://jira.yoyogames.lan:8080/browse/GM-1210]