Scripts / Zone - Allow Player Beyond Map Boundary

Author
Message
OldFlak
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 27th Jan 2015
Location: Tasmania Australia
Posted: 31st Aug 2019 12:00 Edited at: 31st Aug 2019 12:11
Hi all

So I want to allow the player to go beyond the edge of the map in certain places, as per this thread.

So I figured using a Zone to do it.

In PlayerControl_lua I have:
1) added global var g_allowplayerbeyondmapboundary to control if player can leave edge of map or not
2) enclosed the code that prevents player walking off the map in an if statement
------ thanks cybernescence for pointing me to this code
3) edited a zone script to create playeratboundary_control to use in a zone
------ which should change the g_allowplayerbeyondmapboundary





But I be missing something cause it doesn't work, maybe I am on the wrong track here
Any help would be appreciated
aka OldFlak
i7-4790 @ 3.2GHz. 8GB Ram. NVidia GeForce GTX 1060 6GB. M1: Acer 31.5" @1920x1080 M2: Samsung 31.5" @ 1920 x 1080. M3: Acer 24" @ 1920 x 1080. OS: Windows 10 Pro 64-bit Insider.
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 31st Aug 2019 14:28 Edited at: 31st Aug 2019 14:31
Quote: "function replacement_gameplayercontrol_init()
function gameplayercontrol.control()"

your function names don't match up and you need to pass in the 'e' if you're going to use it, it should be
Quote: "function replacement_gameplayercontrol_init(e)
function replacement_gameplayercontrol_main(e)"

also missing an end at the bottom of the first (same) script

the second script needs to set PlrIsInWhichZone = 0 as a default to make the 'if' true (default in lua is nil if nothing is set)

i,e,




with the above changes it works fine, the red barrels are marking the rough map edges (i changed my values to be far smaller so it's easier to show) and the green barrels mark out the zone
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
OldFlak
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 27th Jan 2015
Location: Tasmania Australia
Posted: 31st Aug 2019 15:00 Edited at: 31st Aug 2019 16:02
Thanks for input smallg

Yeah, you are right about the function name, but not sure I can change that, I think it might brake it, but will take in the morning.

The Replacement_GamePlayerControl script is from this thread.

However adding local PlrIsInWhichZone = 0 to the playeratboundary_control fixed it.
Thanks for your help



Reliquia....
aka OldFlak
i7-4790 @ 3.2GHz. 8GB Ram. NVidia GeForce GTX 1060 6GB. M1: Acer 31.5" @1920x1080 M2: Samsung 31.5" @ 1920 x 1080. M3: Acer 24" @ 1920 x 1080. OS: Windows 10 Pro 64-bit Insider.
PM

Login to post a reply

Server time is: 2024-05-08 12:50:46
Your offset time is: 2024-05-08 12:50:46