Mod Question Repository... Questions come in, answers go out
Moderator: Moderators
Re: Mod Question Repository... Questions come in, answers go out
It looks like the airplane plant has something buildin that looks like a repair pad (don't know if it also repairs) but one can also build a repairpad (the description of the repairpad tells that aircraftzs are repaired automaticallybut when I send a plane to the repairpad it also start to guard. By auromatically I understand that one does not have to give a repair command ) (I use ca-stable-6394)
- bobthedinosaur
- Blood & Steel Developer
- Posts: 2702
- Joined: 25 Aug 2004, 13:31
Re: Mod Question Repository... Questions come in, answers go out
Post in the CA sub forums as this is a CA issue. Sorry can't I help more.
- KingRaptor
- Zero-K Developer
- Posts: 838
- Joined: 14 Mar 2007, 03:44
Re: Mod Question Repository... Questions come in, answers go out
The plane will automatically fly to the pad to repair when its health drops below its "Land at" %, I don't know of a way to force it to go home for repairs.
Re: Mod Question Repository... Questions come in, answers go out
Yep, that's exactly what I want.bobthedinosaur wrote:snoop: you want units being built to take no damage until complete?
Re: Mod Question Repository... Questions come in, answers go out
To do that, you need to write some Lua to intercept the damage in the appropriate callin (UnitPreDamaged) which checks the Unit's build state (GetUnitHealth, iirc), and if it's not complete, returns 0.
- bobthedinosaur
- Blood & Steel Developer
- Posts: 2702
- Joined: 25 Aug 2004, 13:31
Re: Mod Question Repository... Questions come in, answers go out
he needs a lua check? no he doesnt
just have it return 0 damage in hit by weapon until being built, via cob
just have it return 0 damage in hit by weapon until being built, via cob
Re: Mod Question Repository... Questions come in, answers go out
HitByWeapon in Lua animation did the trick.
Next question. At the moment I've got a bunch of units that look basically along the lines of:

The problem is the jaggies around the edges of the teamcolour lines.

Is there an easy way of preventing them? The only way I can think of is to be careful when uvmapping to make sure all desired straight lines are perfectly horizontal or vertical; is there a way of doing this effectively on curved surfaces?
Next question. At the moment I've got a bunch of units that look basically along the lines of:


The problem is the jaggies around the edges of the teamcolour lines.

Is there an easy way of preventing them? The only way I can think of is to be careful when uvmapping to make sure all desired straight lines are perfectly horizontal or vertical; is there a way of doing this effectively on curved surfaces?
- bobthedinosaur
- Blood & Steel Developer
- Posts: 2702
- Joined: 25 Aug 2004, 13:31
Re: Mod Question Repository... Questions come in, answers go out
you can try to anti alaise in the texture program you are using, but then you will run into a blurred texture problem. the best solution is to redo the UV map entirely (or the team color areas) with really straight UVs that will minimize the angled team colors.
to other modders. is there a way to adjust the time of the decloak effect after a cloaked unit fires its weapon?
to other modders. is there a way to adjust the time of the decloak effect after a cloaked unit fires its weapon?
Re: Mod Question Repository... Questions come in, answers go out
Yeah, set... meh... I think it's "decloakonfire" to false (check that in Wiki) in the unitDef, then use the COB to set the cloak state manually.
On the aliased lines:
1. You'll hardly ever see that, except in screenshots.
2. If you aren't happy with that, grab the blur tool, set to 3-pixel radius, about 20% - 40% blur, and run it along that line, or lasso that edge (doesn't need to be perfect) and slightly blur it.
On the aliased lines:
1. You'll hardly ever see that, except in screenshots.
2. If you aren't happy with that, grab the blur tool, set to 3-pixel radius, about 20% - 40% blur, and run it along that line, or lasso that edge (doesn't need to be perfect) and slightly blur it.
- bobthedinosaur
- Blood & Steel Developer
- Posts: 2702
- Joined: 25 Aug 2004, 13:31
Re: Mod Question Repository... Questions come in, answers go out
hmm, didnt know about that code, it looks useful. what im looking for with the cloak though is a short fliker when shooting, i want the cloak to stay on but not be completely cloaked when shooting, like a short off then on. should i do that via script with get sets in the shot?
Re: Mod Question Repository... Questions come in, answers go out
Yeah, should be OK.should i do that via script with get sets in the shot?
-
- Posts: 916
- Joined: 27 Jun 2009, 01:32
Re: Mod Question Repository... Questions come in, answers go out
I have a LUPS related question:
I'm thinking of doing an effect via LUPS but have some issues with its integration. While I should have everything needed and also have got a working radar dot spawning mechanism (like in NOTA) I still don't see any distortions or whatever else effects there are. To my understanding things like the distortion gets triggere by e.g. a weapon's AOE and there are lots of effects bound to standard TA unit names...
Still I'm not seeing any of them. Is there an additional "master setting" you have to switch or something to get those effects live?
I'm thinking of doing an effect via LUPS but have some issues with its integration. While I should have everything needed and also have got a working radar dot spawning mechanism (like in NOTA) I still don't see any distortions or whatever else effects there are. To my understanding things like the distortion gets triggere by e.g. a weapon's AOE and there are lots of effects bound to standard TA unit names...
Still I'm not seeing any of them. Is there an additional "master setting" you have to switch or something to get those effects live?
Re: Mod Question Repository... Questions come in, answers go out
This is the script of MR.D's annihilator.
the wanted behavior is for it to close down and retract its head and neck into itself when built.
When an enemy is in range it opens up and starts firing.
After all enemies are gone it has a cooldown period and than it,again,retracts its head and neck into the body until new enemies are inside it's range.
ATM,with this script it does not close when build only after the first shot.
after it shoot something it immediately closes down without a cooldown period and when aiming it constantly moves it's head left and right which looks horrible.
What is the problem in the script?
http://pastebin.com/m23286c57
the wanted behavior is for it to close down and retract its head and neck into itself when built.
When an enemy is in range it opens up and starts firing.
After all enemies are gone it has a cooldown period and than it,again,retracts its head and neck into the body until new enemies are inside it's range.
ATM,with this script it does not close when build only after the first shot.
after it shoot something it immediately closes down without a cooldown period and when aiming it constantly moves it's head left and right which looks horrible.
What is the problem in the script?
http://pastebin.com/m23286c57
Re: Mod Question Repository... Questions come in, answers go out
Mr. D script for Anni fixed Gota has recieved...
- KingRaptor
- Zero-K Developer
- Posts: 838
- Joined: 14 Mar 2007, 03:44
Re: Mod Question Repository... Questions come in, answers go out
So I've got this Lua unit script.
Why does it give this error at unit death and not execute script.Killed()?
Why does it give this error at unit death and not execute script.Killed()?
Code: Select all
attempt to yield across metamethod/C-call boundary
Re: Mod Question Repository... Questions come in, answers go out
I only yesterday wrote my first Lua-unitanimation, and maybe others could answer you so - for me it would be helpful to see the code you're using (I've no idea what the error message means though, so I'll likely not be able to help anyhow :/ )
Edit: hmm, though I was onto something but no...
Starting to deciphre the error - meta-methods are what are used in Lua for building classes (for objects), if I'm not mistaken. So that's likely refering to the class used for "script", I'd guess. I'll try to find out what the "yield" means.
2nd Edit: pardon my asking for the code, I completely missed the link....
Edit: hmm, though I was onto something but no...
Starting to deciphre the error - meta-methods are what are used in Lua for building classes (for objects), if I'm not mistaken. So that's likely refering to the class used for "script", I'd guess. I'll try to find out what the "yield" means.
2nd Edit: pardon my asking for the code, I completely missed the link....
Last edited by SeanHeron on 06 Feb 2010, 11:59, edited 1 time in total.
Re: Mod Question Repository... Questions come in, answers go out
does it work if you remove sleeps?KingRaptor wrote:So I've got this Lua unit script.
Why does it give this error at unit death and not execute script.Killed()?Code: Select all
attempt to yield across metamethod/C-call boundary
Re: Mod Question Repository... Questions come in, answers go out
KingRaptor: do you have link to complete game/mod with this script in it, or simple instructions to create it from an existing game/mod?
- KingRaptor
- Zero-K Developer
- Posts: 838
- Joined: 14 Mar 2007, 03:44
Re: Mod Question Repository... Questions come in, answers go out
There's a bug in it (when starting using Spring menu):
And found the original issue.. bug in my unit script gadget
Now making a fix.
(Removing Sleeps does work though, probably you just forgot one?)
EDIT 2: Fixed in master
EDIT:[string "gamedata/defs.lua"]:37: [string "gamedata/defs.lua"]:25: error = 2, gamedata/unitDefs.lua, error = 2, gamedata/unitdefs_post.lua, [string "gamedata/unitdefs_post.lua"]:63: attempt to perform arithmetic on local 'costMult' (a nil value)
And found the original issue.. bug in my unit script gadget

Now making a fix.
(Removing Sleeps does work though, probably you just forgot one?)
EDIT 2: Fixed in master