Scripts / zones?

Author
Message
Honkeyboy
3D Media Maker
6
Years of Service
User Offline
Joined: 16th Sep 2015
Location: Doesnt know half the time ;)
Posted: 22nd Apr 2021 21:28
I've written an out of bounds script to teleport the player after a few seconds to back in bounds (basically back onto the map where they should be) Script works fine up until i stretch the zone out around quarter of the map size after that just stops working? anyone have any idea why this is happening? thanks guys
Intel i5 4950 Quad core 3.3ghz AMD FX 6300 x6 cores 3.5ghz(unclocked)
8gb Ram 8gb Ram
XFX R5 2gb AMD Radeon HD 6670 2gb
and a well fed mouse on a wheel

I only smile because i have absolutely no idea whats going on
smallg
Community Leader
16
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 22nd Apr 2021 22:47
yes there's a max range on when entities will be active - hence the always active property (but zone's don't have a setting for being always active)
you could try checking the inzone call from a normal entity but for the zone #
i.e. if your zone is entity 15
from an always active entity use
if g_Entity[15]['plrinzone'] == 1 then
to see if that will update even if the zone isn't technically active
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
Honkeyboy
3D Media Maker
6
Years of Service
User Offline
Joined: 16th Sep 2015
Location: Doesnt know half the time ;)
Posted: 23rd Apr 2021 01:42 Edited at: 23rd Apr 2021 01:44
Here's the script m8 at the mo i did try to do it with g_Entity[e]['plrinzone']=1 by stretching the zone around the outside the current one was an area covering the map bar a distance which trigged the transport to wherever and also tried g_Entity[e]['plrinzone']=0 but neither seem to do it correctly at a distance if you get me, its fine for like a small exit but no go on a full map and hey finally got timers down
Intel i5 4950 Quad core 3.3ghz AMD FX 6300 x6 cores 3.5ghz(unclocked)
8gb Ram 8gb Ram
XFX R5 2gb AMD Radeon HD 6670 2gb
and a well fed mouse on a wheel

I only smile because i have absolutely no idea whats going on

Attachments

Login to view attachments
GubbyBlips
3
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 23rd Apr 2021 05:17
Possible to not use a zone, but just solid state map coordinates?
( seeing as I'm not privy to the map design? ) Just a thought.
So -
below finds player { inside } a box if the proper area is relatively square or rectangular it should work,
You can do the trick of a reverse psychology script for player position;

if playerx < ______ and playerx > ______ then
if playerz < ______ and playerz > ______ then
----- do nothing (if in proper location)
else
transport...
end
end

Also, multiply the checks for multiple areas if needed?
It's very easy to acquire the player positions, just Text() them out
as debugging guides.
PM
Honkeyboy
3D Media Maker
6
Years of Service
User Offline
Joined: 16th Sep 2015
Location: Doesnt know half the time ;)
Posted: 23rd Apr 2021 12:15
Thanks guys but I'm pretty sure zone used to work properly in fact BAG's weather system uses one that covers the whole map and i just tested it and it no longer works. I would have thought if your in a zone your in a zone no matter what the size you sure it's not a bug that hasn't been spotted? Oh well I'll probably spend an hour banging a river around it for now
Intel i5 4950 Quad core 3.3ghz AMD FX 6300 x6 cores 3.5ghz(unclocked)
8gb Ram 8gb Ram
XFX R5 2gb AMD Radeon HD 6670 2gb
and a well fed mouse on a wheel

I only smile because i have absolutely no idea whats going on
smallg
Community Leader
16
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 23rd Apr 2021 12:21 Edited at: 23rd Apr 2021 12:21
yep, just tried and can confirm my idea to use an always active entity as the script caller with a zone id does work so just do that

no, zone's have never worked over the whole map, they just have a large range so it's not that noticeable
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
Honkeyboy
3D Media Maker
6
Years of Service
User Offline
Joined: 16th Sep 2015
Location: Doesnt know half the time ;)
Posted: 23rd Apr 2021 14:30 Edited at: 23rd Apr 2021 14:53
righty ok m8 thanks will have a go at that

so would i include the lines into my current script or into a separate script?

added to my current one it just crashes the editor
e.g

Intel i5 4950 Quad core 3.3ghz AMD FX 6300 x6 cores 3.5ghz(unclocked)
8gb Ram 8gb Ram
XFX R5 2gb AMD Radeon HD 6670 2gb
and a well fed mouse on a wheel

I only smile because i have absolutely no idea whats going on
smallg
Community Leader
16
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 23rd Apr 2021 18:18
put the script on a normal entity and replace the 'e' inside the g_Entity[e]['plrinzone'] call with the entity number of the zone
remember to remove the script from the zone too.
so in your example the zone should be entity 1
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: 2022-01-25 04:06:35
Your offset time is: 2022-01-25 04:06:35