Jump to content

[SOLVED] Accessing LUA Script parameters


Roland
 Share

Recommended Posts

If have an entity in my scene with a script attached that holds some parameter, something like this

 

Script.param = 10--int

 

and then in my LUA program at some point picks that entity.

 

Is is possible to access the script.param then (at this stage I have only the entity)

 

I made a temporary solution for this that works by using the Get/SetKeyValue like this

 

Script.param = 10--int

function Script:Start()
self.entity:SetKeyValue("param", self.param)
end

 

which allows me to get that param event though I only have the entity

 

local value = entity:GetKeyValue("param")

 

However this feels a bit odd. Maybe there is some better way ?

 

Note: In C++ I could do this using my LuaBridge class, but this project is pure LUA

Roland Strålberg
Website: https://rstralberg.com

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