Scripts / Opened door is closed after loading the game.

Author
Message
Wolf
Forum Support
16
Years of Service
User Offline
Joined: 8th Nov 2007
Location: Luxemburg
Posted: 24th Jan 2019 12:34
Hello!

A user in the german subsection has the following issue: He has a door that is opened by a switch. However, once he saves and loads the game, the doors is closed again. Is there anything he can do? This is outside of my depht when it comes to scripting.



-Wolf
Tarkus1971
Audio Media Maker
9
Years of Service
User Offline
Joined: 24th Feb 2015
Location: England, UK
Posted: 24th Jan 2019 12:41 Edited at: 24th Jan 2019 12:44
I have found this happens too, i think its a bug, not 100% sure. Even if I open a door normally, when you reload the door is either closed again or open as saved BUT the collision is still on, stopping the player from going though the door. It seems hit and miss with the doors. I think we need a dedicated core engine update to deal with doors and different door types. Not the current way we have to do in lua right now.
Aftershock Quad Core AMD FM2+ 3.5 GHz 8GB Motherboard and Processor, A7700k apu, Asus GT970 STRIX 4gb Nvidia gfx card.
King Korg Synth, Alesis SR18 Drum Machine, Akai MPX8 sample player, Roland Fantom XA Synth, Axus Digital AXK2 Digital Drum Kit, Novation Ultranova Synth, Waldorf Blofeld Synth, Roland D05 Synth Module, Bluedio Victory V Headphones, AKG K141 Studio Headphones, Lenovo Ideapad, with Windows 10 64bit, 8Gb Ram and AMD A10 7th Gen Graphics. Acer Swift i3 Laptop with Intel Optane memory, Intel 620UHD GPU, Windows 10 64bit.
Belidos
3D Media Maker
8
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 24th Jan 2019 12:52 Edited at: 24th Jan 2019 13:01
As far as i know, and i could be wrong, it's not an engine issue, it's a script issue. I think it is because the door scripts use local variables to control the state of the door, and save game only saves global variables, i think the way to fix it would be to make those variables into global variables, but that would mean you would only be able to use one of those scripts per level, to be able to use multiple of the script in a level you would have to create a global array/table ie: g_variable {} above the init, set the initial state of the variable with g_variable(e) = in the init function, and control them with g_variable(e) in the main script, that way they will be saved by the save game system.

I might be totally wrong though, i'm not great at scripting, and i'm not at a GG capable pc to try it on, and without seeing the actual script i'm just guessing.

(Note: g_variable is only an example, you can name it how you like as long as it starts with g_ )

Primary Desktop:
i7 7700,k NV1070 8GB, 16GB 3200mhz memory, 1x 2TB Hybrid, Win10.

Secondary Desktop:
i5 4760k, NV960 2GB, 16GB 2333mhz memory, 1x 2TB Hybrid, Win10.

Laptop:
i3, Intel 4000 series graphics, 6GB memory, 1x 500gb HDD, Win8.1.
Corno_1
GameGuru Tool Maker
13
Years of Service
User Offline
Joined: 3rd Nov 2010
Location:
Posted: 24th Jan 2019 16:14 Edited at: 24th Jan 2019 16:30
Hi,
until I fix this, you can use this script:

It use the haskey field of the door and set it accordingly to the door state. Maybe someone has a cleaner solution, but as a hotfix it works.

SRY

I created a bug:
https://github.com/TheGameCreators/GameGuruRepo/issues/477
Ebe Editor Free - Build your own EBE structures with easy and without editing any text files
Thread and Download
PM
3com
9
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 29th Jan 2019 03:24 Edited at: 29th Jan 2019 03:25
Assume you are talking about standalone, no many experience about that I don't use it almost never, but why don't use script that only open the door?






I've tried in test game mode and it works fine, please try it in standalone mode.
I hope this help.

Or I'm missing something here?
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 29th Jan 2019 09:25
Yh that will have the same issue when you use the switch one because you need to load the door's state, I.e. Make the toggle variables global (g_) and only set them if not existing already.
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11

Login to post a reply

Server time is: 2024-04-24 07:16:25
Your offset time is: 2024-04-24 07:16:25