Feature Creep / Entity Collision Flag

Author
Message
perelect
9
Years of Service
User Offline
Joined: 27th Mar 2015
Location: Australia
Posted: 17th Feb 2016 21:28
I think it would be handy to have a collision flag for entities.
something like..

g_Entity[e]['collision'] = 0
g_Entity[e]['collision'] = 1
g_PlayerCollision = 0
g_PlayerCollision = 1

Say if an entity collides with another entity, then both would report back 1.
I'm working on a pickup and carry script and it would be good to have feedback to know when two or more entities have collided so you can script to drop the object instead of the entity going through walls, etc.

The collision flag would work from the entities collision boxes around it. So if two or more collision boxes hit each other, then it reports.

It would also be good to use it as an event flag, say if a car hits a wall or another car, you could trigger a sound effect or animation, etc.
I think you would want it to report 1 for a collision even if the entities have their collision turned off.
Ill keep with the car theme, picture a finish line beam / ribbon across a track and when the car passes through the ribbon (which would have its collision turned off) it would report back 1 once the car passed through it, and so would the car.

There are lots of different ways you could use a flag like this.

It should even work with the player collision box, and maybe a collision flag for the player as well, like g_PlayerCollision.

But you wouldn't want it to report collision with the terrain.

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)
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 17th Feb 2016 22:05
you sure do know how to dream... but yes completely agree, collision feedback would be great

also the ability to return the size of an object (in all directions - x,y,z) would be nice (you could then detect if it's only a minor collision with a smaller object for example)

and also the ability to return the height of the terrain at any x,z point (not directly related but i think this is needed to detect when an object is "colliding" with the terrain)
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: 18th Feb 2016 16:00
And also the entity id (number) that collide with.

And some command to get the entity id, something like "GetEntityID", and so on....

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

Login to post a reply

Server time is: 2024-04-26 13:09:34
Your offset time is: 2024-04-26 13:09:34