Jump to content

Defining new collision constants/types?


Pastaspace
 Share

Recommended Posts

When it comes to collision types, you have all your basic ones, Prop, Scene, Character, Trigger, Debris, Projectile, LineOfSight, etc.

However, is it possible to define additional collision types, other than the defaults, and add them to the big table of existing collision types? If so, how?

Link to comment
Share on other sites

List of inherent types:

Collision.Prop = 1

Collision.Scene = 2

Collision.Character = 3

Collision.Trigger = 4

Collision.Debris = 5

Collision.Projectile = 6

Collision.LineOfSight = 7

 

List of possible responses:

Collision.None = 0

Collision.Collide = 1

Collision.Trigger = 4

 

With the following warning from Josh concerning using the constants and not the numerical values: "You really should stick to using the named constants. Technically, the values of these are allowed to change at any time, without breaking the spec."

 

Example of use in LUA:

Collision:SetResponse(type, type, response)

entity:SetCollisionType(type)

Collision:SetResponse(10, Collision.Character, Collision.Trigger)

Collision:SetResponse(10, Collision.Prop, Collision.Trigger)

self.entity:SetCollisionType(10)

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...