Melee Unit_Script.lua
Moderator: Moderators
Melee Unit_Script.lua
I can't work out how to make a unit with just a base and a flare attack. Can anybody help?
Re: Melee Unit_Script.lua
you should try to be more specific.
there are a bunch of unit definitions and lua animation scripts here: http://code.google.com/p/zero-k/source/ ... nk/mods/zk if you need examples.
Most of the time melee is faked with invisible laser that has a short range and when unit attacks give it some attacking animation.
there are a bunch of unit definitions and lua animation scripts here: http://code.google.com/p/zero-k/source/ ... nk/mods/zk if you need examples.
Most of the time melee is faked with invisible laser that has a short range and when unit attacks give it some attacking animation.
Re: Melee Unit_Script.lua
relevant to interessants.
I know/thought about the invisible lasers but not the details. Like what point do you shot the laser from, does that matter? Would it be a good idea to shot the laser from a point high above the unit instead of ie from the head so always has clear los to fire?
I know/thought about the invisible lasers but not the details. Like what point do you shot the laser from, does that matter? Would it be a good idea to shot the laser from a point high above the unit instead of ie from the head so always has clear los to fire?
Re: Melee Unit_Script.lua
Its been a while since I experimented with it, but if you move the fire point far away (like up) it will affect the range the unit can attack from. If you give it cylindrical targeting than afaik it can hit air units! which is probably not desired behavior.
If you want always clear line of fire, you could have it shoot through allies and ignore them etc... IIRC SA does this? In my experiments I always had the fire point be either the head or torso and seemed to work fine. I forget the actual tags that let you bypass allies but you can probably look them up.
And ofc when testing you can make the laser visible so you know how your mechanics are working.
If you want always clear line of fire, you could have it shoot through allies and ignore them etc... IIRC SA does this? In my experiments I always had the fire point be either the head or torso and seemed to work fine. I forget the actual tags that let you bypass allies but you can probably look them up.
And ofc when testing you can make the laser visible so you know how your mechanics are working.
Re: Melee Unit_Script.lua
lol true. but could be solved with targetcategory thing.If you give it cylindrical targeting than afaik it can hit air units! which is probably not desired behavior.
I want this for the miners in CT. Atm they use a machine gun like "cannon type" weapon. They usually work well but it seems sometimes the engines pathing is too stupid to put them in a position to mine correctly, like when is on a cliff or something and they try to mine (=shot) it from down below.
Re: Melee Unit_Script.lua
Learn 2 cylinder target!maackey wrote:If you give it cylindrical targeting than afaik it can hit air units! which is probably not desired behavior.

Re: Melee Unit_Script.lua
Thanks for the link, but I'm using lua.maackey wrote:you should try to be more specific.
there are a bunch of unit definitions and lua animation scripts here: http://code.google.com/p/zero-k/source/ ... nk/mods/zk if you need examples.
Most of the time melee is faked with invisible laser that has a short range and when unit attacks give it some attacking animation.
Re: Melee Unit_Script.lua
The unit is just a ball (base) with a flare.