Continuing the discussion from Newbie Top-down Game Problems - Entering Doors:
My question is:
I don’t know if it’s better to use the extension dialog (YARNeditor) to do the same and save memory or not.
The green area has a condition (when the player is in collision with) and a action (show spirte and show text on position x/y).
The red area is the limitation (do not cross).
If i debug the game i see, that if the player is not in collision with the green area my sprite and text is not showing (so it’s good), and when the player is in collision with the green area my sprite and text will be showing (it’s good too).
But after the player was in collision with the green area my sprite and text is only set to hide at the same position of x and y as it was showing!
So i had to “move” it back from the scene where it was on start.
Now it’s perfect.
But without the dialog extension!
From scene editor:
From preview (without collision):
From debug (without collision):
From preview (with collision):
From debug (with collision):
After moving back from the door it looks like “From preview (without collision):” and “From debug (without collision)”.
Is is one way!
Another way cloud be with “Create/Delete an object”?
Where are the differents?
Extension dialog (YARNeditor) added in the text above.
I’m not sure I understand completely, but I think you may just need to add a “Trigger Once” to the collision check for the green box, that way it will only pop up the dialog and do the actions once until the player moves off of the green box completely and then tries to re-enter.
My game above works fine, no need to trigger once.
Now i’ve tested it with create and delete object and this - i think - is much more better (because of less “code” snippets).
But my question isn’t answered yet.
Sorry but i’ve to push this thread up because my question isn’t answered yet.
What is the best way to save memory?
- Do it like i did with “add an action” create/delte the window when the player is in action with a door
- or with a third party extension (YARNeditor)?
Neither of these things will have any real memory difference outside of a few bytes.
You are loading the same amount of text in both cases, just in different object types. Since the amount of text characters are the same, and the font is the same, there won’t be any real difference.
Regardless if your code works right now or not, the suggestion above about trigger once will be your best bet to have any real performance impact. Without it the events are constantly being checked every frame, rather than only
running during frames where the conditions first become true.
After my question is answered - thanks for that - and after i saw the following video, i would to know if it is possible to do the dialog in an “external event” and change it (the values) for each scene? Because in another scene there are another things like people who you can talk to…
After i saw how much “code” in gdevelop is requiered for the yarneditor dialoge, it would be better if the dialog can be in an “external event” and can be modified (however) to change it for each “object” in each scene.
If anybody knows how to do this, please share it.