Mod Question Repository... Questions come in, answers go out - Page 47

Mod Question Repository... Questions come in, answers go out

Resources to get you going on your new project, or to help you over some emergent problems during your development cycle.

Moderator: Moderators

Locked
thedude
Posts: 66
Joined: 21 Aug 2009, 12:47

Re: Mod Question Repository... Questions come in, answers go out

Post by thedude »

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)
User avatar
bobthedinosaur
Blood & Steel Developer
Posts: 2702
Joined: 25 Aug 2004, 13:31

Re: Mod Question Repository... Questions come in, answers go out

Post by bobthedinosaur »

Post in the CA sub forums as this is a CA issue. Sorry can't I help more.
User avatar
KingRaptor
Zero-K Developer
Posts: 838
Joined: 14 Mar 2007, 03:44

Re: Mod Question Repository... Questions come in, answers go out

Post by KingRaptor »

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.
User avatar
PTSnoop
Posts: 97
Joined: 09 Sep 2009, 19:05

Re: Mod Question Repository... Questions come in, answers go out

Post by PTSnoop »

bobthedinosaur wrote:snoop: you want units being built to take no damage until complete?
Yep, that's exactly what I want.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Mod Question Repository... Questions come in, answers go out

Post by Argh »

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.
User avatar
bobthedinosaur
Blood & Steel Developer
Posts: 2702
Joined: 25 Aug 2004, 13:31

Re: Mod Question Repository... Questions come in, answers go out

Post by bobthedinosaur »

he needs a lua check? no he doesnt

just have it return 0 damage in hit by weapon until being built, via cob
User avatar
PTSnoop
Posts: 97
Joined: 09 Sep 2009, 19:05

Re: Mod Question Repository... Questions come in, answers go out

Post by PTSnoop »

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:

Image Image

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

Image

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?
User avatar
bobthedinosaur
Blood & Steel Developer
Posts: 2702
Joined: 25 Aug 2004, 13:31

Re: Mod Question Repository... Questions come in, answers go out

Post by bobthedinosaur »

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?
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Mod Question Repository... Questions come in, answers go out

Post by Argh »

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.
User avatar
bobthedinosaur
Blood & Steel Developer
Posts: 2702
Joined: 25 Aug 2004, 13:31

Re: Mod Question Repository... Questions come in, answers go out

Post by bobthedinosaur »

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?
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Mod Question Repository... Questions come in, answers go out

Post by Argh »

should i do that via script with get sets in the shot?
Yeah, should be OK.
Master-Athmos
Posts: 916
Joined: 27 Jun 2009, 01:32

Re: Mod Question Repository... Questions come in, answers go out

Post by Master-Athmos »

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?
User avatar
Gota
Posts: 7151
Joined: 11 Jan 2008, 16:55

Re: Mod Question Repository... Questions come in, answers go out

Post by Gota »

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
User avatar
Noruas
XTA Developer
Posts: 1269
Joined: 24 Feb 2005, 02:58

Re: Mod Question Repository... Questions come in, answers go out

Post by Noruas »

Mr. D script for Anni fixed Gota has recieved...
User avatar
KingRaptor
Zero-K Developer
Posts: 838
Joined: 14 Mar 2007, 03:44

Re: Mod Question Repository... Questions come in, answers go out

Post by KingRaptor »

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
SeanHeron
Engines Of War Developer
Posts: 614
Joined: 09 Jun 2005, 23:39

Re: Mod Question Repository... Questions come in, answers go out

Post by SeanHeron »

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....
Last edited by SeanHeron on 06 Feb 2010, 11:59, edited 1 time in total.
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Re: Mod Question Repository... Questions come in, answers go out

Post by imbaczek »

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
does it work if you remove sleeps?
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Re: Mod Question Repository... Questions come in, answers go out

Post by Tobi »

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?
User avatar
KingRaptor
Zero-K Developer
Posts: 838
Joined: 14 Mar 2007, 03:44

Re: Mod Question Repository... Questions come in, answers go out

Post by KingRaptor »

http://kraptor.eat-peet.net/THIS_WIP11_beta2.sd7

Commenting out the sleeps didn't help.
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Re: Mod Question Repository... Questions come in, answers go out

Post by Tobi »

There's a bug in it (when starting using Spring menu):
[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)
EDIT:
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
Locked

Return to “Game Development Tutorials & Resources”