plz help i really need 1 and i never tried
Forum
CS2D General lua script helplua script help
8 replies 1
plz help i really need 1 and i never tried
But I guess you could search for like lua on google and you might get some good results.
its not really easy
i really need a script and i mean iit takes like 1 day teaching it if your god
you can't script "a new unit in gfx". you also can't add new weapons or stuff like that.
addhook is before the functions, its just 180 degrees around lol
vrkiller has written
Lua is one of the badest languages i ever tryd, it just dosent make sense and its stupid
addhook is before the functions, its just 180 degrees around lol
addhook is before the functions, its just 180 degrees around lol
You need to study the language design rather then just conceptualize it with regards to the traditional languages. Unlike static languages out there, Lua is one of the most dynamic languages you'll come to know, similarly, unlike languages such as Java where it's almost impossible to map out any one class-type, lua offers only the essentials.
Addhook is an inhouse function, here's a bit of its language design
lua have states, states are not statically inherited into the object they're exposed to, in this case, the runtime that blitz uses constantly updates the lua state. In such a case, you can use addhook before or after the function it's pointed to because by design, blitz takes the NAME of the function and maps it to the _G table. In this sense, addhook does nothing more then calling out the function at the key provided by the second parameter. This is a rather intuitive design because it allows us to use the full potentials of the dynamic nature of lua. Rather then binding the hook to a static function, blitz allows the function to "mutate" either independently or through exterior manipulation. In such a sense it's an essential feature that allows us to employ quite a variety of "esoteric" problem solving techniques.
A better understanding of the language design can be found by tracing out how a program runs. It may be beneficial to see where the conventional techniques ends and where the esoteric forms begins.
you can also write addhook AFTER the declaration of functions. it simply doesn't matter because the position of the declaration of functions in the source code does not matter as well. you should know that if you used other languages before.
1