Mod Question Repository... Questions come in, answers go out
Moderator: Moderators
- bobthedinosaur
- Blood & Steel Developer
- Posts: 2702
- Joined: 25 Aug 2004, 13:31
- bobthedinosaur
- Blood & Steel Developer
- Posts: 2702
- Joined: 25 Aug 2004, 13:31
Re: Mod Question Repository... Questions come in, answers go out
get unitheight on hit spheres = radius. cool works great.
now the same on custom collision boxes? it isn't the Y, i tried that.
any ideas?
now the same on custom collision boxes? it isn't the Y, i tried that.
any ideas?
Re: Mod Question Repository... Questions come in, answers go out
I suspect it is the radius of the sphere as set in upspring (i.e. it ignores custom colvol.)
But I hope I'm wrong.
But I hope I'm wrong.
- bobthedinosaur
- Blood & Steel Developer
- Posts: 2702
- Joined: 25 Aug 2004, 13:31
Re: Mod Question Repository... Questions come in, answers go out
it is not once you use a box
edit: not true (found after more testing)
edit: not true (found after more testing)
Last edited by bobthedinosaur on 29 Jun 2010, 03:47, edited 1 time in total.
Re: Mod Question Repository... Questions come in, answers go out
Code: Select all
case UNIT_HEIGHT:{
if (p1 <= 0)
return (int)(unit->radius * COBSCALE);
CUnit *u = (p1 < uh->MaxUnits()) ? uh->units[p1] : NULL;
if (u == NULL)
return 0;
else
return (int)(u->radius * COBSCALE);}
However, radius might change from that set in Upspring. From a quick glance at the code, it is possibly the radius of the bounding sphere of the custom colvol.
- bobthedinosaur
- Blood & Steel Developer
- Posts: 2702
- Joined: 25 Aug 2004, 13:31
Re: Mod Question Repository... Questions come in, answers go out
hmm
It looks like you were right flozi. Custom collisions are ignored by unitheight, and it is reverted back to the the sphere.
It looks like you were right flozi. Custom collisions are ignored by unitheight, and it is reverted back to the the sphere.
- bobthedinosaur
- Blood & Steel Developer
- Posts: 2702
- Joined: 25 Aug 2004, 13:31
Re: Mod Question Repository... Questions come in, answers go out
Okay. Here is a really ugly script that I am having issues with the weapon1 firing at all. I know it is the script because I have changed out weapons that I know work and it fails to fire. I have also replaced the aimweapon1 script with a bare minimum and it still fails to fire.
Any help bug fixing I would be most gracious!
http://pastebin.com/z0d9s4U2
Any help bug fixing I would be most gracious!
http://pastebin.com/z0d9s4U2
Re: Mod Question Repository... Questions come in, answers go out
If you've tried AimWeapon1(){return(1);}I have also replaced the aimweapon1 script with a bare minimum and it still fails to fire.
...then the problem is elsewhere. Are you using aiming cones, etc. that might be causing an issue?
- bobthedinosaur
- Blood & Steel Developer
- Posts: 2702
- Joined: 25 Aug 2004, 13:31
Re: Mod Question Repository... Questions come in, answers go out
It is not the weapon's issue. I have weapons that work on the same unit, and other units running for the test. It is something in the script that doesn't let it aim.
- FireStorm_
- Posts: 666
- Joined: 19 Aug 2009, 16:09
Re: Mod Question Repository... Questions come in, answers go out
Before addressing this one should probably know I have no programming background (besides perhaps my own brain
). And I'm trying to Lua script a unit by looking at examples and reading the wiki.
Question:
Can I show an animation of the unit dying or falling over after the call-in 'Killed' was called? I started like this:
function script.Killed(recentDamage, maxHealth)
StartThread( Diescript )
return 1
end
'Diescript' is ofcourse my animation of the unit falling to the ground. But calling 'Killed' makes the unit disappear (or be replaced with a corpse), and a disappeared unit cant show an animation. So how should/can this be done? I hope my question is not to ignorant to be taken seriously.

Question:
Can I show an animation of the unit dying or falling over after the call-in 'Killed' was called? I started like this:
function script.Killed(recentDamage, maxHealth)
StartThread( Diescript )
return 1
end
'Diescript' is ofcourse my animation of the unit falling to the ground. But calling 'Killed' makes the unit disappear (or be replaced with a corpse), and a disappeared unit cant show an animation. So how should/can this be done? I hope my question is not to ignorant to be taken seriously.
Re: Mod Question Repository... Questions come in, answers go out
The unit is removed when killed() returns. Do the animation in the same thread as that function (just call diescript() instead of running it in a new thread).
- FireStorm_
- Posts: 666
- Joined: 19 Aug 2009, 16:09
Re: Mod Question Repository... Questions come in, answers go out
I see my mistake now. The way I wrote it the function is a thread, which makes it run parallel, which caused my problem. I should have written Diescript() where i put StartThread( Diescript )
I'm actually starting to get some of this stuff. Thanks Peet.
I'm actually starting to get some of this stuff. Thanks Peet.
Re: Mod Question Repository... Questions come in, answers go out
Is there a weapon tag to prevent explosions from damaging friendly units? I've tried CollideFriendly=0 but the quite-excessively-large area of effect is still damaging friendly units. Or will this have to be a Lua thing?
Re: Mod Question Repository... Questions come in, answers go out
Lua. Not too hard to do that one though, I believe that several games have a noselfpwn gadget kicking around that could easily be expanded to all friendlies. It'd be a good starter-project to learn Lua, really.PTSnoop wrote:Is there a weapon tag to prevent explosions from damaging friendly units? I've tried CollideFriendly=0 but the quite-excessively-large area of effect is still damaging friendly units. Or will this have to be a Lua thing?
- CarRepairer
- Cursed Zero-K Developer
- Posts: 3359
- Joined: 07 Nov 2007, 21:48
Re: Mod Question Repository... Questions come in, answers go out
http://trac.caspring.org/browser/trunk/ ... lyfire.luaPTSnoop wrote:Is there a weapon tag to prevent explosions from damaging friendly units? I've tried CollideFriendly=0 but the quite-excessively-large area of effect is still damaging friendly units. Or will this have to be a Lua thing?
Re: Mod Question Repository... Questions come in, answers go out
I ended up messing around with CA's noselfpwn, but didn't get it working exactly how I wanted.
But the nofriendlyfire gadget (which I didn't notice for some reason) is working perfectly. And I learnt a bit of Lua in the process! Thanks guys.
But the nofriendlyfire gadget (which I didn't notice for some reason) is working perfectly. And I learnt a bit of Lua in the process! Thanks guys.
Re: Mod Question Repository... Questions come in, answers go out
Is a feature that is not selectable still reclaimable if it has an autoreclaimable=1 and a reclaimable=1 tag?
Re: Mod Question Repository... Questions come in, answers go out
yup, try a area reclaim next to it.Beherith wrote:Is a feature that is not selectable still reclaimable if it has an autoreclaimable=1 and a reclaimable=1 tag?
Re: Mod Question Repository... Questions come in, answers go out
Is it possible to give a build command to a gaia factory?
(I couldn't find a build command to use it for Spring.Give Order() )
(I couldn't find a build command to use it for Spring.Give Order() )
Re: Mod Question Repository... Questions come in, answers go out
Factories have two queues, one build queue and one rally queue (the orders that go to units built by it), check the wiki page on the CMDs, I think it's described there.