Mod Question Repository... Questions come in, answers go out
Moderator: Moderators
Re: Mod Question Repository... Questions come in, answers go out
I mean, is it an empty piece, a single vertex, two vertices or more? The piece might contain vertices that describe a zero vector.
- Evil4Zerggin
- Posts: 557
- Joined: 16 May 2007, 06:34
Re: Mod Question Repository... Questions come in, answers go out
Ah, that must be it then. After moving the fire point to a different piece it seemed to work as desired (except for firing from a different place that I wanted to, but that's to be expected). Thanks!
Now I have to figure out how to add fire pieces that do work... unfortunately I don't know anything about modeling.
Now I have to figure out how to add fire pieces that do work... unfortunately I don't know anything about modeling.
- bobthedinosaur
- Blood & Steel Developer
- Posts: 2702
- Joined: 25 Aug 2004, 13:31
Re: Mod Question Repository... Questions come in, answers go out
okay looking for away other than on/off (since on off is toggling the unit from movable to deployed) to choose between 2 weapons, only one or the other, besides fancy lua, got any idea?
- Pressure Line
- Posts: 2283
- Joined: 21 May 2007, 02:09
Re: Mod Question Repository... Questions come in, answers go out
manual toggle? or an automatic system? ie tank has only a light laser gun while moving, when stopped it allows its big cannon to fire. that is doable in cob
- bobthedinosaur
- Blood & Steel Developer
- Posts: 2702
- Joined: 25 Aug 2004, 13:31
Re: Mod Question Repository... Questions come in, answers go out
no it will be stopped when 'on' is engaged because that deploys it to attack, versus non attackable via moving. so the switch can not use the on/off or moving true to differentiate between the 2 weapon types..
Re: Mod Question Repository... Questions come in, answers go out
Within a gadget:
This creates a button that calls the COB function "ChangeWeapon()" when clicked. I'm sure it's possible to make this use a toggle button instead of a simple click button but I have no experience with those.
The button only appears for units with
in the fbi.
Code: Select all
CMD_WEAPON = 33319
desc = {
name="Change Weapon", --button label
type=CMDTYPE.ICON, --a button that activates when clicked on
id=CMD_WEAPON,
action="changeweapon"
}
--For new units
function gadget:UnitCreated(u,ud,defs)
if UnitDefs[ud].customParams.canchangeweapon == "1" then
Spring.InsertCmdDesc(u, desc) --add the command to the unit's list
end
end
--Blocks commands that are invalid
function gadget:AllowCommand(u,ud,team,cmd,param,opt)
if cmd == CMD_WEAPON then
return UnitDefs[ud].customParams.canchangeweapon == "1" --makes sure CMD_WEAPPON can only be given to units that can change their weapon
end
return true
end
--Handles custom commands
function gadget:CommandFallback(u,ud,team,cmd,param,opt)
if cmd == CMD_WEAPON then
Spring.CallCOBScript(u, "ChangeWeapon", 0) --calls this COB function
return true, true
end
return false
end
The button only appears for units with
Code: Select all
[customParams] {
canChangeWeapon=1;
}
Re: Mod Question Repository... Questions come in, answers go out
Is there a way... to make a beam that fires constantly (like the beamer turret) to keep firing when sweep to another target?
-
- Posts: 1176
- Joined: 23 Aug 2007, 19:46
Re: Mod Question Repository... Questions come in, answers go out
Try sweepfire=1 ... 

Re: Mod Question Repository... Questions come in, answers go out
The last time I tested, Sweepfire had some issues. Mainly, it seems to change targets without calling AimWeapon() again, so the beam goes in wonky directions. May have been fixed since I last messed with it, though, give it a try.
Re: Mod Question Repository... Questions come in, answers go out
Yeah when they try to target something behind another unit, they go a bit mad, but other wise fine (targeterror was turned off)
Re: Mod Question Repository... Questions come in, answers go out
Wondering about shields... Apparantly some binary or something or other allows shields to block certain weapons.. anyway, I was wondering, a. is it possible to have more than one 'shield' per unit. b. Is it possible to forcibly turn shields on or off via script (and have there be no on/off option in gui - onoffable=0?) c. are shields technically weapons?
Re: Mod Question Repository... Questions come in, answers go out
A. Yes, so far as I know, there are no limits on the number of Shields a Unit may have. Keep in mind they're fairly CPU-intensive, though.
B. Yes. See the Changelog for details. You could either use Activate() or a separate LUA button via the UI to control it.
C. Only in the broadest sense of the word. They don't call aiming conditions, etc.
B. Yes. See the Changelog for details. You could either use Activate() or a separate LUA button via the UI to control it.
C. Only in the broadest sense of the word. They don't call aiming conditions, etc.
Re: Mod Question Repository... Questions come in, answers go out
A shield runs AimWeaponX and if that returns true the shield is active. I'm making extensive use of shields in CvC, that might be worth a look.
Re: Mod Question Repository... Questions come in, answers go out
So i'm guessing shields on pretty much every unit that would be turning on and off would be too CPU-intensive? I know spring can have more than 3 weapons per unit... what is the max amount of weapons per unit tho? I heard somewhere that shields can actually deflect weapons, rather than just absorb them, can they do either? Shields, I'm assuming, are just the effect of blocking/deflecting a weapon, so you'd have to make a part of the model that 'looks' like a shield as well, correct?
Re: Mod Question Repository... Questions come in, answers go out
Shields can have a visible part if you set them to, you can make deflecting shields and destroying shields (i.e. projectiles hit them and explode). I don't think the on/off part will do much to the CPU, having the shields visible could eat FPS in large numbers due to the rendering tho.
- bobthedinosaur
- Blood & Steel Developer
- Posts: 2702
- Joined: 25 Aug 2004, 13:31
Re: Mod Question Repository... Questions come in, answers go out
kdr, what does the bos look like using that widget?
-
- Posts: 1176
- Joined: 23 Aug 2007, 19:46
Re: Mod Question Repository... Questions come in, answers go out
It's 16 if I'm still right...Ba- wrote:what is the max amount of weapons per unit tho?
At the end of this Wiki article you should find everything you want to know:Ba- wrote:I heard somewhere that shields can actually deflect weapons, rather than just absorb them, can they do either? Shields, I'm assuming, are just the effect of blocking/deflecting a weapon, so you'd have to make a part of the model that 'looks' like a shield as well, correct?
http://spring.clan-sy.com/wiki/Weapon_V ... scriptions
With that said - yes, you can either do a repulsor shield which reflects projectiles or you make some sort of "hard shield" where everything explodes when touching the shield surface. You also can set it to work like an umbrella (i.e. the shield doesn't affect anything that is inside the shield range or make it affect the whole spherical area it consumes. Well you'll find all the options in that Wiki article...
Well you for example could put a variable in the active() function which gets set to 1 and so triggers a while loop you've put in the aiming function which returns a TRUE to activate the shield. The deactivate function then switches the variable to 0 and this way you deactivate your shield...bobthedinosaur wrote:kdr, what does the bos look like using that widget?
Re: Mod Question Repository... Questions come in, answers go out
You have a ChangeWeapon() function that changes the active weapon.bobthedinosaur wrote:kdr, what does the bos look like using that widget?
- bobthedinosaur
- Blood & Steel Developer
- Posts: 2702
- Joined: 25 Aug 2004, 13:31
Re: Mod Question Repository... Questions come in, answers go out
sorry i have not yet used the change weapon command, where would it go in the bos in order to receive widget triggers?
-
- Posts: 854
- Joined: 28 Jan 2005, 18:15
Re: Mod Question Repository... Questions come in, answers go out
You'll just be adding a new function. You can place it in any position (well, not inside another function's block). Spring figures the rest out for you.