Vehicle light properties; script to set all vehicles - Lua Help!

Your forum for all discussions around Modding.
Nad42
Posts: 2
Joined: Sat Nov 27, 2010 11:42 am

Vehicle light properties; script to set all vehicles - Lua Help!

Post by Nad42 »

Hi All,

I've tried to figure out Lua on a number of occasions but as a relatively proficient python/php/javascript scripter I still cannot get my head around where to start with a lua script...

All I want to do is have a script that blanket sets the headlights (Ctrl+F) for all vehicles to a greater range.. I have no idea where to start; do you do it when the game loads the file at the beginning do you just do it when each vehicle loads, do you do it when you actually switch the light on???

...and then how do you even begin with this; what files do I need how do I structure it etc.

Where do I look for reference to figure out what functions to use, looking at the Giants documentation just confuses me even further!?

Then how is the best way to test stuff (loading the game over and over takes way too long!)

Can anyone point me to any scripts or examples of something that might be half similar to what I want to achieve. If anyone has any advice at all I would greatly appreciate it!.

Note: I'm not asking for someone to just write me a script; I genuinely want to figure out how to do this lua scripting as I've got so many ideas that I could do!
Nad42
Posts: 2
Joined: Sat Nov 27, 2010 11:42 am

Re: Vehicle light properties; script to set all vehicles - Lua Help!

Post by Nad42 »

So here's where i am:

documentation and instructions out there are utterly stuff, they are all aimed at either someone who already knows what they are doing (lists of stuff lua functions that are very specific... i.e. utterly useless) or at someone who wants to edit a existing mod or create maps etc and are all missing that vital middle step between writing lua and interfacing with the game... which seems to be archaic at best! I've played around in the very buggy giants remote debugger and found out lots but still I am absolutely no closer to actually making the headlights range any different! I still cant really figure out how to get from lua to edit what's basically an i3d node property... all i3d nodes look like from lua is a string of nodes, I have no idea what to then do with this or how to edit the properties of the nodes.

Any insight here would be great if anyone is out there!

Thanks.
Post Reply