Scripts / entityinzone ???

Author
Message
dimoxinil
18
Years of Service
User Offline
Joined: 20th Mar 2006
Location:
Posted: 31st Dec 2015 11:51 Edited at: 31st Dec 2015 11:53
Anyone know any practical example with g_Entity[e]['entityinzone'] and GetEntityInZone(e) ?

Thank you for your time!

My little APOCALYPSE world My little APOCALYPSE world

wermer
8
Years of Service
User Offline
Joined: 18th Sep 2015
Location:
Posted: 31st Dec 2015 18:36
I did some tests, and couldn't get anything to work.
Windows 10 Home 64-bit / Intel i5 2500k @ 4.4Ghz + Asetek 510LC / Intel DP67DE / Intel 530 Series 240GB SSD / 12GB Kingston KVR 1333 / XFX Radeon R9 285 / Corsair TX 650 / Antec 300
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 31st Dec 2015 18:54
i was going to ask that question too as i was trying to get it to work the other day and could get no response from it at all (except a few resets of GG )
maybe Lee missed a bit of code.

haven't tried the xmas beta though, either of you using it?
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, AMD R9 200 series , directx 11
wermer
8
Years of Service
User Offline
Joined: 18th Sep 2015
Location:
Posted: 31st Dec 2015 19:48
I tried it and found that it fixed nothing for me... I have enough bugs in the "stable" version.
Windows 10 Home 64-bit / Intel i5 2500k @ 4.4Ghz + Asetek 510LC / Intel DP67DE / Intel 530 Series 240GB SSD / 12GB Kingston KVR 1333 / XFX Radeon R9 285 / Corsair TX 650 / Antec 300

Attachments

Login to view attachments
PM
perelect
9
Years of Service
User Offline
Joined: 27th Mar 2015
Location: Australia
Posted: 31st Dec 2015 20:44 Edited at: 15th Jan 2016 12:16
Here is how I got it to work.
I had to ask to...
cybernescence told me.

A script and a map is attached.

[Edit]
This is the quote for lees blog about how to use the commands.
Quote: "You can now call a command called GetEntityInZone(e) which will then fill a value in the entity elements array called g_Entity[e][‘entityinzone’] which represents the entity ID of any entity that enters a marker zone."
Desktop: Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz (8 CPUs), ~3.6GHz, Windows 8.1 64-bit, 16 GB Ram, NVIDIA GeForce GTX 750 Ti, Display Memory: 4018 MB. Resolution 1360x768, Passmark 3528.
Laptop: Pavilion dv6 Notebook, Intel(R) Core(TM) i5-2410M CPU @ 2.30 GHz, Win 7 64 bit, 16 GB Ram, Radeon (TM) HD 6490M, 2336 MB Memory. Resolution 1366x768, Intel(R) HD Graphics 3000. (WEI 5.8)

Attachments

Login to view attachments
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 31st Dec 2015 22:01
thanks perelect, i've never use any of the other functions like that so i wouldn't have thought to try it

rather than being able to detect all objects in a zone it can only detect the last object to enter a zone, useful i guess but would be nicer to have a command that could work the other way and tell you which zone the entity ('e') is in.
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, AMD R9 200 series , directx 11
wermer
8
Years of Service
User Offline
Joined: 18th Sep 2015
Location:
Posted: 31st Dec 2015 22:14 Edited at: 31st Dec 2015 22:17
Great work perelect! Your demo works for me! I wonder why UpdateEntity isn't populating the field like everything else.

To take things a step further: It looks like they forgot a line in global.lua.

IMO, the GetEntityInZone function in global.lua should look like this:


This makes it's usage much more consistent with GetPlayerInZone and reduces your demo script from 3 lines to 1.
GetEntityInZone, and GetPlayerInZone are supposed to be "convenience" functions which are easier to type and remember than "g_Entity[e]['entityinzone']" and "g_Entity[e]['plrinzone']". IMO, we shouldn't need to use both, and this is another example of inadequate and/or completely missing documentation.

@smallg
I thought it was only the last entity in the zone too, but it seems to actually be the highest entity number that gets returned.
Windows 10 Home 64-bit / Intel i5 2500k @ 4.4Ghz + Asetek 510LC / Intel DP67DE / Intel 530 Series 240GB SSD / 12GB Kingston KVR 1333 / XFX Radeon R9 285 / Corsair TX 650 / Antec 300
PM
3com
9
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 31st Dec 2015 23:59
Quote: "I thought it was only the last entity in the zone too, but it seems to actually be the highest entity number that gets returned"


You are right, in fact I thought about use it to know how many entities are in zone, when notice it.

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
perelect
9
Years of Service
User Offline
Joined: 27th Mar 2015
Location: Australia
Posted: 1st Jan 2016 02:57
Your welcome guys.

Quote: "I thought it was only the last entity in the zone too, but it seems to actually be the highest entity number that gets returned"


Its not doing that for me..

For me its returning the last entity number that entered the zone..

Ill have a look at it..
Desktop: Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz (8 CPUs), ~3.6GHz, Windows 8.1 64-bit, 16 GB Ram, NVIDIA GeForce GTX 750 Ti, Display Memory: 4018 MB. Resolution 1360x768, Passmark 3528.
Laptop: Pavilion dv6 Notebook, Intel(R) Core(TM) i5-2410M CPU @ 2.30 GHz, Win 7 64 bit, 16 GB Ram, Radeon (TM) HD 6490M, 2336 MB Memory. Resolution 1366x768, Intel(R) HD Graphics 3000. (WEI 5.8)
dimoxinil
18
Years of Service
User Offline
Joined: 20th Mar 2006
Location:
Posted: 1st Jan 2016 10:40
Hi!

Many thanks to all for your help.

I'm not using xmas beta though. I'm working with the build 1.111. Perelect thank you for this example!

I also think that documentation is sparse. The Scripts are not my strong suit and all my progress in this area are due to your scripts examples.

Infinit gratitude..... and a happy new year.!!!!


My little APOCALYPSE world My little APOCALYPSE world

smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 1st Jan 2016 14:06
Quote: "@smallg
I thought it was only the last entity in the zone too, but it seems to actually be the highest entity number that gets returned."

yh after a bit more testing it does seem to be the highest entity number only, i was hoping for a way to tell when a specific entity is in a zone and when he leaves but i dont think it's possible with the current command (it almost is but if anything with a higher entity number is in the zone it messes it up)

Quote: "To take things a step further: It looks like they forgot a line in global.lua."

it's not normally in the global part but does at least work there so nice fix for now

Quote: "You are right, in fact I thought about use it to know how many entities are in zone, when notice it"

another thing that doesnt work with the current command.

hopefully they will change this to a more useful version after the xmas break
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, AMD R9 200 series , directx 11
3com
9
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 1st Jan 2016 14:54
I think that command belong to things such as radar, to know who is in zone, but it is not yet fully integrated.

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
wermer
8
Years of Service
User Offline
Joined: 18th Sep 2015
Location:
Posted: 1st Jan 2016 17:52
Quote: "I think that command belong to things such as radar, to know who is in zone, but it is not yet fully integrated."


The command isn't used in the radar scripts at all. Let's not make excuses. Frankly, it's broken and it's undocumented. If it's not finished then it shouldn't be released. g_Entity[e]['entityinzone'] and GetEntityInZone(e) could easily be "hidden" from us until they are documented and ready to use.
Windows 10 Home 64-bit / Intel i5 2500k @ 4.4Ghz + Asetek 510LC / Intel DP67DE / Intel 530 Series 240GB SSD / 12GB Kingston KVR 1333 / XFX Radeon R9 285 / Corsair TX 650 / Antec 300
PM
perelect
9
Years of Service
User Offline
Joined: 27th Mar 2015
Location: Australia
Posted: 1st Jan 2016 23:40 Edited at: 4th Jan 2016 01:21
Quote: "I thought it was only the last entity in the zone too, but it seems to actually be the highest entity number that gets returned."


Ok I have found a scenario where this occurs.
Say there is an entity in the zone that has a value of 10 and if another new entity enters the zone which has an value greater than 10, then this is detected. But if the value of the new entity is less then 10, then it is not detected.

Q. Is this what you guys are talking about or seeing ?

If so I will report it as a Beta bug, so it will get addressed.


Quote: "yh after a bit more testing it does seem to be the highest entity number only, i was hoping for a way to tell when a specific entity is in a zone and when he leaves but i dont think it's possible with the current command (it almost is but if anything with a higher entity number is in the zone it messes it up)"


@smallg
You got me thinking about the "i was hoping for a way to tell when a specific entity is in a zone and when he leaves ".
That would be handy. So I got it working. You just have to beware of the bug when setting up the map.

Map and script attached.

[UPDATE]
@all
I have been trying to create a function that will return weather an entity is within a particular zone.
I need help as I cannot work out how to do this. Any help would be great.
The array/table part is my problem that I just cannot work out.
Hopefully the below is clear and understandable.



Cheers
Desktop: Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz (8 CPUs), ~3.6GHz, Windows 8.1 64-bit, 16 GB Ram, NVIDIA GeForce GTX 750 Ti, Display Memory: 4018 MB. Resolution 1360x768, Passmark 3528.
Laptop: Pavilion dv6 Notebook, Intel(R) Core(TM) i5-2410M CPU @ 2.30 GHz, Win 7 64 bit, 16 GB Ram, Radeon (TM) HD 6490M, 2336 MB Memory. Resolution 1366x768, Intel(R) HD Graphics 3000. (WEI 5.8)

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-04-27 17:23:52
Your offset time is: 2024-04-27 17:23:52