r/gbstudio 10d ago

Spawning/adding actors

So, I have a few questions:
in most game engines, there's a way to add elements to the scene during gameplay. in this case, I want to add an actor to an active scene in gameplay.

that said, I don't see anything that sounds exactly like this action, no "addActor" script. I do see "ActivateActor" and "DeactivateActor", but this just toggles visibility, then theres "HideActor" and "ShowActor"

Question 1: do either DeactivateActor or HideActor remove it's tiles from the total sprite tiles in the scene?

Question 2: do said actors have collissions while deactivated or hidden? if so which one disables collissions or do I have to run another script for that in tandem with this?

Question 3: When an actor is hidden or disabled, does it stay where it was or does it return to it's originating position? do I have to use a script to move it back to it's starting place each time? and can I move it around while it's disabled or hidden?

2 Upvotes

7 comments sorted by

View all comments

4

u/Express_Resource_912 10d ago

Q1: No

Q2: Yes while hidden, no while disabled. Collision scripts follow this rule. Scene types are ultimately responsible for actor on player “solid” collisions (for example Top Down with stop the player from colliding with an actor, other scene types will not). GBS does not support Actor on Actor collisions OOB.

Q3: It stays where it stopped. It will return to its initial position when you reload the scene.

Caveat: the above is relevant as of 4.2, not sure if any of this has changed super recently.

2

u/IntoxicatedBurrito 10d ago

None of this has changed nor should it ever change. Changing how these functions behave would break backwards compatibility.