Scripts / I'm looking for an LUA command

Author
Message
3com
9
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 4th Oct 2019 06:45 Edited at: 4th Oct 2019 07:06
I'm looking for a LUA command that allows me to quickly differentiate between objects and characters, but I can't find anything.
I'm missing something?
Or maybe this command does not exist yet.

Some sort of:
IsCharacter(e)
IsMarker(e)
IsObject(e)
IsPlayer(e)

If I have a map with many items I would like to know what are objects (a house, a cardboard box, a lamp, etc.) or a character (a soldier, a zombie, a creature, etc)

The same could be extensible to markers or to the same player, if it turns out that I have 400 items on a map how can I know which player is, number 40, 340, or maybe 23?

To understand my doubts, you must take into account a factor, and that is that the map is not mine, the map could be of any user who is using this script, therefore I do not have any data of their map or of the items that are part of the map.

I try to improve the way in which the characters manage the obstacles, although I tried a masked soldier and the truth does not make it so bad, although with some nuances that would have to be resolved.
I'm usually trying to finish the pack I'm working on, but from time to time I need to change to something totally different, even just for a moment.

PS: Just for adding something. I've found reading DarkAI docs, talking about a LUA command named "AISet EntityCollide" I have not found it in global LUA file.
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: 4th Oct 2019 18:00
player is g_PlayerObjNo (might also need g_PlayerThirdPerson but i don't think so)
the rest you will likely need to check some specific variable in their script - characters have ai_bot_substate for example
lights have their own ID's but objects are all under g_Entity[e]['obj'] (including characters) so to differentiate zones and objects you can check g_Entity[e]['plrinzone'] - returns -1 for non-zones or 0/1 for zones
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: 4th Oct 2019 19:48 Edited at: 4th Oct 2019 19:52
@ smallg
Quote: "player is g_PlayerObjNo (might also need g_PlayerThirdPerson but i don't think so)"

Yes, I'm using it to check the player obj.

Quote: "the rest you will likely need to check some specific variable in their script - characters have ai_bot_substate for example"
[quote=]

Working with collision I should work with premisse than every char is a char and does not matter if him is static or dynamic, if he is running or does not a script, if he is or does not animated char, etc.
I should work with all the items belong to the map, because all them in any moment can be a obstacle the chararcter has to sort out, or he can be a obstacle itself, or the 2 things at time.

For that reason differentiate between chars, objets, markers, etc is a mandatory here.
Markers /decals can't be a collision objet, but identify then might help to excluded them as obstacle object, and also might help me with other project I'm working to. (handling items on map, in test mode) more friendly use than f9, at least I hope so.

Interface base


looking for some item on the map


the resut


With some sort of "IsChar(e)" it migh be easier.
Work with static ones might be a challenge, since them does not return any info, but I've a couple of ideas.
Getting the name and id even for the static ones, is not a problem.

Disabling temporarily the GG special keys such as shift, ctrl, enter, etc is a paint and the only one way I've found is trhu the setup.ini file, obviously this not an option here. Even I've open a thread in github

Thanks mate for the tips.

Edit: fixing typos.
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

Attachments

Login to view attachments
PM

Login to post a reply

Server time is: 2024-04-23 23:22:20
Your offset time is: 2024-04-23 23:22:20