Buttons, idles and load screen

Started by Peegee, Mon 11/10/2021 14:57:25

Previous topic - Next topic

Crimson Wizard

#40
Quote from: Peegee on Wed 03/11/2021 17:42:57
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?

Quote from: Khris on Wed 03/11/2021 17:44:14
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.

Peegee

I cannot reset rooms every time I enter them because sometimes I enter a room which must have kept its previous state.

Crimson Wizard

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)?

Quote from: Peegee on Wed 03/11/2021 17:42:57
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.

Peegee

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.

Crimson Wizard

Quote from: Peegee on Wed 03/11/2021 18:23:11
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?

Peegee

... so how can we do a full backup?

Crimson Wizard

Quote from: Peegee on Wed 03/11/2021 18:25:45
... 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.

Peegee

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.

Crimson Wizard

#48
Quote from: Peegee on Wed 03/11/2021 18:30:10
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.

Peegee

Ok Crimson Wizard, thanks for your help. I will do like that, but I apprehend and I protest !

Khris

#50
Nobody cares.
If you can't figure out how to do this with save games / non-saving rooms, you need to do it manually.

Peegee

(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

SMF spam blocked by CleanTalk