Mod Question Repository... Questions come in, answers go out
Moderator: Moderators
- bobthedinosaur
- Blood & Steel Developer
- Posts: 2702
- Joined: 25 Aug 2004, 13:31
Re: Mod Question Repository... Questions come in, answers go out
i added some sounds now spring locks up at weapondefs (last entry in info log after taskmanager kill spring), what do i need to look for?
Re: Mod Question Repository... Questions come in, answers go out
Depends on how you added the sounds. If you just dumped them into the project (i.e., the old way) then you may have a problem with a sound being corrupt or a WAV format Spring doesn't handle well.
If you're using sounds.lua (the new, much better way) then you need to be veeeeery careful about case-sensitivity.
I.E.:
If that's really "incoming_Chat.wav" in the actual file name, then you're hosed. Had lots of "fun" with this and other issues of case-sensitivity until I figured out what was borked. Same goes double for script references- BOS scripts are case-sensitive, and if you play-sound("Incoming_chat",10) when the reference is "Incoming_Chat", you will see a crash.
If you're using sounds.lua (the new, much better way) then you need to be veeeeery careful about case-sensitivity.
I.E.:
Code: Select all
local Sounds = {
SoundItems = {
--- RESERVED FOR SPRING, DON'T REMOVE
IncomingChat = {
file = "sounds/incoming_chat.wav",
rolloff = 0.1,
maxdist = 10000,
priority = 100, --- higher numbers = less chance of cutoff
maxconcurrent = 1, ---how many maximum can we hear?
},
},
}
return sounds
- bobthedinosaur
- Blood & Steel Developer
- Posts: 2702
- Joined: 25 Aug 2004, 13:31
Re: Mod Question Repository... Questions come in, answers go out
which wav format works best with spring? I'm using audacity to edit and save sounds, and it has these options:

I should also not audacity is set at 44.1kHz
I should also not audacity is set at 44.1kHz
- Attachments
-
- wav options.jpg
- (81.94 KiB) Downloaded 184 times
- bobthedinosaur
- Blood & Steel Developer
- Posts: 2702
- Joined: 25 Aug 2004, 13:31
Re: Mod Question Repository... Questions come in, answers go out
Okay, since I cant find any docs on it. I'm guessing spring does not like stereo, and must have its wav's mono maxed at 44.1kHZ and in 16bit format?
Re: Mod Question Repository... Questions come in, answers go out
I have noticed crashes with stereo sounds on some hardware, yes.
Re: Mod Question Repository... Questions come in, answers go out
I'm just curious - how much about a unit can be changed at run-time in Lua, without having to replace it with a new, pre-defined unit?
Can I change the primary weapon (ie: unit goes underwater, a secondary jammed torpedo launcher replaces the surface weapon as the primary)?
Can I change firing range? Projectile sizes? Features like stun/concussion/damage of the projectile? Muzzle velocity?
Can pieces be resized? The collision sphere? The cruisealt?
I don't want details of how to do anything, just a yes/no so I can figure out how achievable a project I have in mind is.
Thanks in advance.
Can I change the primary weapon (ie: unit goes underwater, a secondary jammed torpedo launcher replaces the surface weapon as the primary)?
Can I change firing range? Projectile sizes? Features like stun/concussion/damage of the projectile? Muzzle velocity?
Can pieces be resized? The collision sphere? The cruisealt?
I don't want details of how to do anything, just a yes/no so I can figure out how achievable a project I have in mind is.
Thanks in advance.
Re: Mod Question Repository... Questions come in, answers go out
Well... hrmm. IIRC, we aren't able to write to the UnitDefs table on the fly, so a truly new Unit... no. Maybe that's changed since the last time I looked at that, but I don't think we're allowed to write all-new UnitDefs once it's initialized.I'm just curious - how much about a unit can be changed at run-time in Lua, without having to replace it with a new, pre-defined unit?
That said, you can play with a lot of properties... and use transformation code or just a simple swap to go between "modes".
As for weapons: you can change quite a few properties of a weapon, either with BOS or Lua, but you're not allowed to change the appearance without using some fairly fancy Lua.
Pieces may be re-sized, but only with fancy Lua, and that fancy Lua doesn't exist yet, so far as I know. Technically possible, yes. Something you can do without programming it, no.
The collision sphere, or cube / column / etc. may be arbitrarily moved, resized, etc.
The cruisealt is totally non-negotiable, and is a fixed part of the UnitDef.
Re: Mod Question Repository... Questions come in, answers go out
Hmm... I could fake a changed cruise-alt by moving the collision-sphere and pieces around, though, couldn't I? For a gunship, I mean, not a fighter. Oh, wait, that would probably look terrible when it aimed downwards, right.
What do you mean by "pieces may be resized, but only with fancy lua"? Can COB resize a piece?
What do you mean by "pieces may be resized, but only with fancy lua"? Can COB resize a piece?
Re: Mod Question Repository... Questions come in, answers go out
Yes, with vertex deformation. Ask zxswg if he'll write a scaling algorithm, that is almost certainly possible.Can COB resize a piece?
Otherwise, you'd have to do it with Lua, drawing the Piece at a new scale.
Re: Mod Question Repository... Questions come in, answers go out
No.Argh wrote:Yes, with vertex deformation. Ask zxswg if he'll write a scaling algorithm, that is almost certainly possible.Can COB resize a piece?
Otherwise, you'd have to do it with Lua, drawing the Piece at a new scale.
COB Cannot do vertex deformation, and never has been able to. Why you insist on perpetuating your myth that it can is beyond me. There is no way to scale a piece in Cob other than using multiple pieces and show/hide.
Re: Mod Question Repository... Questions come in, answers go out
Just Argh being Argh. I guess he got confused by seeing my boobies.
Re: Mod Question Repository... Questions come in, answers go out
Well, shit. And it's such a simple transformation! So the only way to do a dynamically resized piece is to actually have it drawn in Lua using the OpenGL API?FLOZi wrote:Argh wrote:*snip*Can COB resize a piece?
COB Cannot do vertex deformation, and never has been able to. Why you insist on perpetuating your myth that it can is beyond me. There is no way to scale a piece in Cob other than using multiple pieces and show/hide.
- bobthedinosaur
- Blood & Steel Developer
- Posts: 2702
- Joined: 25 Aug 2004, 13:31
Re: Mod Question Repository... Questions come in, answers go out
how does CURRENT_SPEED work? i can't seem to compare it to MAX_SPEED when im trying to figure out at what stage a unit is in the accelerating or deaccelerating process. is it not on the same scale as max_speed and just a percentage of it?
Does CURRENT_SPEED and MAX_SPEED just not work with air units? I am getting bizarre results.
Does CURRENT_SPEED and MAX_SPEED just not work with air units? I am getting bizarre results.
Re: Mod Question Repository... Questions come in, answers go out
<shrugs> If zxswg says it's just me mis-remembering, then it's probably my brain misfiring.COB Cannot do vertex deformation, and never has been able to. Why you insist on perpetuating your myth that it can is beyond me. There is no way to scale a piece in Cob other than using multiple pieces and show/hide.
I thought there was an example of this in one of the radar models, back in the day. It was only used in maybe one-two Cavedog models, I thought, and I thought I remembered reading about it being one of the mysterious curiosities that nobody ever did anything with because it was such a pain in the ass, because you had to have the vertex number, or something equally awful.
But yeah, I must be thinking of something else. Maybe I'm mixing it up with the stuff I did with Freelancer's engine, where we did various hex-edit silliness to mess with their bloody awful animation system. It's been awhile. Dunno why I keep thinking that it was an unfold sequence or something, where the verts did something that can't be done with move / rotate, but whatever, I'm wrong, and if I'm not wrong, then obviously nobody knows how to do it and it must be a pain in the butt.
So, basically, yeah, use OpenGL. If you just want to resize it, that's pretty easy, anyhow, the only trick is intercepting that Piece's display list.
But... one question... what do you want piece size transforms for? I mean, if you just want Units that change size due to some condition, but it's a fixed size, that's easy, and you don't necessarily have to get into OpenGL to do that. If you want really dynamic stuff, like a Piece that is resized over time... not so much, that will get a bit tricky and kinda expensive.
- bobthedinosaur
- Blood & Steel Developer
- Posts: 2702
- Joined: 25 Aug 2004, 13:31
Re: Mod Question Repository... Questions come in, answers go out
Why is it that adjusting max speed to air just kills the unit, and makes it sink to the ground?
Also once again, how the hell do you use CURRENT_SPEED with air?
edit: testing current speed it apparently jumps to 99 when moving and does not account for acceleration, and it does not drop when an aircraft is refueling, but it does during landing...
Also once again, how the hell do you use CURRENT_SPEED with air?
edit: testing current speed it apparently jumps to 99 when moving and does not account for acceleration, and it does not drop when an aircraft is refueling, but it does during landing...
- bobthedinosaur
- Blood & Steel Developer
- Posts: 2702
- Joined: 25 Aug 2004, 13:31
Re: Mod Question Repository... Questions come in, answers go out
"define GROUND_WATER_HEIGHT 78 // get land height, negative if below water "
does not actually get a negative value if below water like it says it does, or not for buildings?
Currently I am detecting water to delete (self destruct) a feature that may accidentally spawn in water, but I have to use setSFXoccupy, which on some maps will delete them all if the ground water is to high.
Any suggestions?
does not actually get a negative value if below water like it says it does, or not for buildings?
Currently I am detecting water to delete (self destruct) a feature that may accidentally spawn in water, but I have to use setSFXoccupy, which on some maps will delete them all if the ground water is to high.
Any suggestions?
Re: Mod Question Repository... Questions come in, answers go out
Use Lua to get the groundheight at x,z (unit's base position) instead of COB.
Re: Mod Question Repository... Questions come in, answers go out
If it doesn't go negative just check for 0.
Re: Mod Question Repository... Questions come in, answers go out
It's possible that GROUND_HEIGHT goes negative instead. One of them does IIRC
Re: Mod Question Repository... Questions come in, answers go out
GROUND_HEIGHT2 does AFAIK.rattle wrote:It's possible that GROUND_HEIGHT goes negative instead. One of them does IIRC