It was alphanumerically sorted in the context of LUA. I would be surprised if it was read merely by string in Spring, but it may have to have been, due to the number of places and odd contexts used by play-sound. At any rate, if we can call it through a simple filename, in an include or just within the body of the script, that would make things nice and simple.1. I think the global sound list isn't alphabetical after all.
Play sound needs some work.
Moderator: Moderators
As far as I can tell spring has a global array of sounds, and has an array for each script that holds an index for the global array, which gets loaded based on filename. *_*Argh wrote:It was alphanumerically sorted in the context of LUA. I would be surprised if it was read merely by string in Spring, but it may have to have been, due to the number of places and odd contexts used by play-sound. At any rate, if we can call it through a simple filename, in an include or just within the body of the script, that would make things nice and simple.1. I think the global sound list isn't alphabetical after all.
But it should be relatively simple to use.
The current plan:
GET PLAY_SOUND (coded, half tested)
p1: sound number
p2: volume as a float * 100
p3: 0 = alos, 1 = los, 2 = los or radar, 3 = global, 4 = ally, 5 = team (optional, defaults to alos)
p4: 0 = play at unit location, 1 = play directly (optional, defaults to unit location)
GET PLAY_SOUND_LOCATION (coded)
p1: sound number
p2: volume as a float * 100
p3: XZ coordinates
p4: Y coordinate (optional, defaults to the map/water height)
Add observedsound and worldsound tags to weapons. (todo)
Finally figured out wtf was causing my grief, the fact that the volume is capped at 1-ish, so passing a big number makes it audible on all the map, but not loud, blah blah blah, I hate directsound. I'll have the get play_sound patch on mantis in a couple hours, with a test build here to play with.
EDIT: latest svn is causing horrible horrible issues with my example mod, bah tomorrow
EDIT: latest svn is causing horrible horrible issues with my example mod, bah tomorrow
Okay, finally got back around to finishing this. Read the link for details:
http://spring.clan-sy.com/mantis/view.php?id=690

Necron Slowpoke
http://spring.clan-sy.com/mantis/view.php?id=690

Necron Slowpoke

No commit yet, I just submitted it.
And here's as good a place as any for me to explicitly state the following (these were in the flankingBonus patch):
You can now do negative damage to units.
You can set a modrules variable, experienceMult, that will be multiplied by all experience a unit gaines. So if you want to have a mod without experience, or want to manage experience yourself, set it to 0.
And here's as good a place as any for me to explicitly state the following (these were in the flankingBonus patch):
You can now do negative damage to units.
You can set a modrules variable, experienceMult, that will be multiplied by all experience a unit gaines. So if you want to have a mod without experience, or want to manage experience yourself, set it to 0.
Don't forget to document that stuff, for the Changelog. This version has a huge number of things in it, we don't want stuff not getting used because it wasn't documented 
As for the rest... well, I've already tested flankingShield, which appears to work correctly... I'll have to test those two. Negative Damage might be a big deal in PURE, although I'm a bit worried about filtering... I'll test against Armor Table stuff and see what happens- I don't want to heal enemy Units. And I wonder if negative damage could also create positive geometry on the heightmap...
As for experienceMult, that's something definitely worth testing. Could be useful, for a variety of game-balance purposes...

As for the rest... well, I've already tested flankingShield, which appears to work correctly... I'll have to test those two. Negative Damage might be a big deal in PURE, although I'm a bit worried about filtering... I'll test against Armor Table stuff and see what happens- I don't want to heal enemy Units. And I wonder if negative damage could also create positive geometry on the heightmap...
As for experienceMult, that's something definitely worth testing. Could be useful, for a variety of game-balance purposes...
Well this only affects the damage to units. You could set the damage to negative before, and it would recharge shields but do 0 damage to units. I'm not sure about craters, but it's the same as before. And are you talking about the dynamic damage code? Because iirc that has its own filter for negative damage.Argh wrote:Don't forget to document that stuff, for the Changelog. This version has a huge number of things in it, we don't want stuff not getting used because it wasn't documented
As for the rest... well, I've already tested flankingShield, which appears to work correctly... I'll have to test those two. Negative Damage might be a big deal in PURE, although I'm a bit worried about filtering... I'll test against Armor Table stuff and see what happens- I don't want to heal enemy Units. And I wonder if negative damage could also create positive geometry on the heightmap...
As for experienceMult, that's something definitely worth testing. Could be useful, for a variety of game-balance purposes...
Well the best I can do is give you an svn build with my patch included.
I think it should sync with the normal rev 4944...
http://xta.wolfgame.org/SimBase/spring.exe
I think it should sync with the normal rev 4944...
http://xta.wolfgame.org/SimBase/spring.exe