Jibble

Author Topic: Buttons, idles and load screen  (Read 2149 times)

Re: Buttons, idles and load screen
« Reply #40 on: 03 Nov 2021, 18:05 »
He enters the room, he throws what there is in the After fade in, but he does not reset anything (neither the variables, nor the positions of characters or objects).

I'm sorry, I don't understand, what throws what in "After fade in"?... where in script exactly do you call ResetRoom?

You can; exit the editor and rename the room files.

You have to enter the room number in the room properties. Renaming room file on disk will make editor not find it next time, because it has room numbers written in the project file also.
« Last Edit: 03 Nov 2021, 18:08 by Crimson Wizard »

Re: Buttons, idles and load screen
« Reply #41 on: 03 Nov 2021, 18:06 »
I cannot reset rooms every time I enter them because sometimes I enter a room which must have kept its previous state.

Re: Buttons, idles and load screen
« Reply #42 on: 03 Nov 2021, 18:22 »
I just quickly tested ResetRoom in AGS 3.5.1, and it appears working. There might be something else in your case that meddles with things. Maybe it never gets called, or there's something in room's script that changes object positions (just a guess)?

neither the variables, nor the positions of characters or objects

Please note that only "room objects" are reset by ResetRoom. Characters are global objects and do not change their states. Also global variables are not changed, because they don't belong to particular room.

Re: Buttons, idles and load screen
« Reply #43 on: 03 Nov 2021, 18:23 »
I am in room1, I do some actions, then I go to a special room where I have items to start the save. There I put "player.ChangeRoom (1)" to go to the room and I put ResetRoom (1), I come back to my room1 but it didn't reset anything.

Re: Buttons, idles and load screen
« Reply #44 on: 03 Nov 2021, 18:24 »
I am in room1, I do some actions, then I go to a special room where I have items to start the save. There I put "player.ChangeRoom (1)" to go to the room and I put ResetRoom (1), I come back to my room1 but it didn't reset anything.

Please tell, what do you have in room 1 that needs to be reset?

Re: Buttons, idles and load screen
« Reply #45 on: 03 Nov 2021, 18:25 »
... so how can we do a full backup?

Re: Buttons, idles and load screen
« Reply #46 on: 03 Nov 2021, 18:29 »
... so how can we do a full backup?

Write a function in the room script that sets everything to their starting positions. Call it from "Before fade-in" event, for example, checking if certain global variable is set. Set that global variable whenever you need to reset the room.

Re: Buttons, idles and load screen
« Reply #47 on: 03 Nov 2021, 18:30 »
I need to reset several characters their states, their location, the state of the inventory, the objects that I have picked up, or not, all the variables ... I don't understand that it is so complicated. I can also do the backup "by hand", listing everything I want to reset, but I have very rich levels and it can be complex and problematic.

Re: Buttons, idles and load screen
« Reply #48 on: 03 Nov 2021, 18:35 »
I need to reset several characters their states, their location, the state of the inventory, the objects that I have picked up, or not, all the variables ... I don't understand that it is so complicated. I can also do the backup "by hand", listing everything I want to reset, but I have very rich levels and it can be complex and problematic.

Yes, you would have to do this by hand, there's no other way, because in AGS characters and inventory items do not belong to the room, but to the "global" state. And it does not let to reset only the part of the global state automatically.
« Last Edit: 03 Nov 2021, 18:37 by Crimson Wizard »

Re: Buttons, idles and load screen
« Reply #49 on: 03 Nov 2021, 18:53 »
Ok Crimson Wizard, thanks for your help. I will do like that, but I apprehend and I protest !

Re: Buttons, idles and load screen
« Reply #50 on: 04 Nov 2021, 10:52 »
Nobody cares.
If you can't figure out how to do this with save games / non-saving rooms, you need to do it manually.
« Last Edit: 04 Nov 2021, 11:02 by Khris »

Re: Buttons, idles and load screen
« Reply #51 on: 15 Nov 2021, 14:18 »
(it was a joke)
Yes finally I do almost the reset by hand, in the room load, but I still put ResetRoom, to reset objects, sometimes more problematic. I have currently resolved my backup issues, including double level issues. Regards