Scripts / Entity in Zone

Author
Message
Tarkus1971
Audio Media Maker
9
Years of Service
User Offline
Joined: 24th Feb 2015
Location: England, UK
Posted: 12th Jun 2016 15:15
Is there any way of detecting if a certain entity is inside a trigger zone. I can't seem to fathom out how this might work?
Aftershock Quad Core AMD FM2+ 3.5 GHz 8GB Motherboard and Processor, A7700k apu, AMD HD7870 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.
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 12th Jun 2016 17:12
afaik right now no, there is a command to get the number of an entity in a zone but it only returns the highest entity number from everything in that zone - so not really very useful.
we need a command that works the other way and lets us detect which zone an entity might be in.
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
3com
9
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 12th Jun 2016 17:14
What I did:

1- Place trigger zone and attached script below
2- place civilian masked over the trigger zone (do not want soldier shutting me)
3- When player close to the trigger zone being prompted about ai internal number, so if you get their internal number (id) you can work with.



otherwise involves modifying the script of the entity, obtain the id, declare a global variable and store the id, so the trigger zone code , can know what number entity is.

curious about how you managed to get entity going into the trigger zone, at least you thing about a very big trigger zone.
hth

3com
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

PM
Tarkus1971
Audio Media Maker
9
Years of Service
User Offline
Joined: 24th Feb 2015
Location: England, UK
Posted: 13th Jun 2016 12:12 Edited at: 13th Jun 2016 12:13
thanks smallg, 3com, im working on a puzzle where im pushing something into a zone, and when the object enters the zone an event would, happen i guess thats one puzzle for adding later.
Aftershock Quad Core AMD FM2+ 3.5 GHz 8GB Motherboard and Processor, A7700k apu, AMD HD7870 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.
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 13th Jun 2016 19:04
if you can get away without the zone and can use distance from one object to another then that would be best, something like a pressure pad type effect.
i have the function to check the distance for 2 objects in my thread (functions are linked at top of page 1)

an alternative would be to check the distance of the player to the object and then check the player is in the zone... would work for your needs
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
Northern
13
Years of Service
User Offline
Joined: 5th Nov 2010
Location: Brazil
Posted: 16th Jun 2016 06:39
@Tarkus1971:

Tarkus1971 wrote:

Quote: "Is there any way of detecting if a certain entity is inside a trigger zone. I can't seem to fathom out how this might work?"


Once I put two overlapped trigger zones to detect two different objects. However, this solution may not work correctly, if you have dozens of entities to detect their presence. In both zones is necessary to inform in the scripts the respective values for (e), of the objects, which should be detected.

Note: The solution above was not tested with the latest release 1.131 of the GameGuru.

Greetings,
Northern
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 16th Jun 2016 17:16
If you don't mind your puzzle being aligned with the x/z axis (and assuming it is a rectangular zone) then you can simply check whether the entity is within the bounds of the zone, if you need to move the puzzle around then place a small object down where you want the zone to be and specify the zone edges as offsets from the object position.
Been there, done that, got all the T-Shirts!
PM
Tarkus1971
Audio Media Maker
9
Years of Service
User Offline
Joined: 24th Feb 2015
Location: England, UK
Posted: 16th Jun 2016 17:21
Thanks for the help guys, I will try out all your suggestions and see how things go. Just writing a new survival script set here, sprite heavy and very deep.
Aftershock Quad Core AMD FM2+ 3.5 GHz 8GB Motherboard and Processor, A7700k apu, AMD HD7870 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.

Login to post a reply

Server time is: 2024-05-04 12:20:01
Your offset time is: 2024-05-04 12:20:01