Can you precache animations like you do with sounds, and how much can you transfer from C# to Glua?
3 replies, posted
[B]Tl;dr:[/B] Title.
[B]In Depth Explanation:[/B]
So I was wandering how, if at all posible, you can precache animations, like you can do with sounds?
An example could be:
[code]precachedSound = Sound( sound_name.wav )[/code]
Now, if I wanted to do the same thing, say with a player enumeration, how should I do?
My other question is a bit difficult to explain, but I will do my best.
I've been working with C#, and was wondering if there are any syntax you can transfer to Glua, wether slightly altered or not?
For example in C# I can write:
[code]
variable = condition ? resultIfConditionIsTrue : resultIfConditionIsFalse;
[/code]
instead of writing:
[code]
if (condition) then{variable = resultIfConditionIsTrue;}else{variable = resultIfConditionIsFalse;}end}
[/code]
Sorry for my english and coding, I am in a bit of a hurry.
I'm not sure about precaching animations but for your C# to Lua ternary question, yes lua has a kind of weird ternary system.
[code]
local var = condition and conditionIfTrue or conditionIfFalse
-- Shorthand alternative
local var = condition or conditionIfFalse -- This will set var to condition if true or conditionIfFalse otherwise.
[/code]
I wouldn't say Lua and C# are similar enough to 'transfer' the syntax, but I'd say that all the basic programming needs from C# still exist in lua.
Also be sure to skim throug the [URL="http://www.lua.org/pil/"]Programming in Lua Book[/URL] to learn some basics.
You don't recache animations.
[editline]26th March 2015[/editline]
Animations are stored in a model. You can precache models.
Thank you very much, both of you! :)
Sorry, you need to Log In to post a reply to this thread.