Jump to content

Recommended Posts

Posted

( LUA ) 

I'm trying to preform a few simple tasks with no luck whatsoever.

1) Get and Set an Entities NAME.

2) Cycle through a worlds Entity list.

3) Create a custom Collision Type

4) Get a single Entities TAG (  collidedEntity:GetTag() ) does not exist or collidedEntity:GetName() or something. 

5) When using World:GetTaggedEntities() what suffix is the handle in the LUA table ?
 For example:

self.UAGCLadders = world:GetTaggedEntities("UAGCLADDER")

Theres no example or documentation telling me what handle this data is stored under in the table. Ex:  self.UAGCLadders.WHATGOESHERE ?

I can cycle the table like self.UAGCLadders[1] but its much easier not keeping track of table lengths. #self.UAGCLadders.

        for t=1, #self.UAGCLadders do
        end

 

Appreciate any help you may be able to give. I've been stuck on these for a few days now.

 

Posted

1)  entity.name = "name"

2) Only in maps - map.entities. For World only tagged and in area

3) Just set an integer bigger than 6 with Entity:SetCollisionType. btw @Josh CollisionType enum seems being not exposed in LUA

local NEW_COLLISION = 7

box1:SetCollisionType(NEW_COLLISION)

https://www.ultraengine.com/learn/Entity_SetCollisionType?lang=lua

https://www.ultraengine.com/learn/World_SetCollisionResponse?lang=lua

4) No GetTag() atm but it should be possible to iterate entity.tags but in my test example it return nil so probably not exposed in LUA @Josh

5) Not sure what you mean :unsure:

Maybe you want that:

for n, entity in pairs(world:GetTaggedEntities("tag")) do
    local entity = Entity(entity)
    Print(entity.name)
end
  • Thanks 1

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.

×
×
  • Create New...