Jump to content

Lua : getShapeValues ?


YouGroove
 Share

Recommended Posts

I placed a box in the scene and attached script.

This box will be hidden , only visible in editor as it will be an invisible zone.

 

I would need by code to retrieve the AABB box of that cube i placed.

Is there any way ?

 

I have AABB(x,y,z,x1,y1,z1) to create the AABB

But how can i retrieve the box vertex of corners to create the AABB ?

But there is not GetShape() ?

 

The goal is to place boxes in the level, with attached script , and at start automatically,

each box has the start function creating a AABB that will be a zone used in the game.

In fact this is some evolution of Rick's volume trigger script.

Stop toying and make games

Link to comment
Share on other sites

Thanks Rick.

I didn't seen that function, that will fit perfectly.

 

In fact OnEnter and OnLeave, need to be in the physic engine, caus it should work with any physic polygon collision shapes, eo the only hope is after 3.1 to ask again for these functions.

 

Here my purpose is just to create some zone system object we can reuse using flowGraph.

You place a cube in the scene with the "zone" script.

 

In the FlowGraph, you will be able to connect your cube to some Pivot, or entity having some function code receiving it's output.

1 ) At start of the game , the cube in start function :

- will call Hide() : so it's visible when editing your level, but no more at runtime :)

- will call then GetAABB so it's AABB wil exist

2) in it's loop function :

- Will detect if some entity position center is within it's AABB

Perhaps entity and method of script entity entered during scene editing in the panel properties of that zone cube ?

- then the code will just call : some getEntityByName + call this methode

it could be : player.DoDamageBurn()

 

It depends if this is for several models like Goblins when entering some trap area would be damaged one time, or if this zeveral zones specificaly enteracting with player only ?

 

In each case You can go with

1 ) Flowgraph and connect zones to player,

or

2) No Flowgraph and enter values in zone properties like :

- entity Script name

-entity method to call

Stop toying and make games

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...