iirc you can do that with hitbyweapon() tooKDR_11k wrote:Not really but you can use Lua to trigger on UnitDamaged and add random extra damage.
Mod Question Repository... Questions come in, answers go out
Moderator: Moderators
- Pressure Line
- Posts: 2283
- Joined: 21 May 2007, 02:09
Hello guys, I'm new and just wanted to ask for some help.
So far I've created just one simple unit. No animations, nothing. Let's say I wanted to replace XTA commander's model. How would I do that?
For some background information, I'm pretty sure I've got the unit right. I've made it in Wings3D, UV-mapped it with a tutorial, and went through the UpSpring mess. I have a .s3o file, with the UV pictures in .tga format with alpha channels.
So with that, I went and copied XTA. Went into the directory for FBI files and edited something in the 'External' section. I can't remember what it was, but I changed it to replace the .3do file with my .s3o file.
Now whenever I start Spring, it crashes. I think I still have the info log the crash, and if anyone needs it, just ask.
Anyways, my main question is what did I do wrong? Can anyone supply me with a good tutorial to follow, or just give me some basic instructions? Thanks for all your guy's help in advance.
So far I've created just one simple unit. No animations, nothing. Let's say I wanted to replace XTA commander's model. How would I do that?
For some background information, I'm pretty sure I've got the unit right. I've made it in Wings3D, UV-mapped it with a tutorial, and went through the UpSpring mess. I have a .s3o file, with the UV pictures in .tga format with alpha channels.
So with that, I went and copied XTA. Went into the directory for FBI files and edited something in the 'External' section. I can't remember what it was, but I changed it to replace the .3do file with my .s3o file.
Now whenever I start Spring, it crashes. I think I still have the info log the crash, and if anyone needs it, just ask.

Anyways, my main question is what did I do wrong? Can anyone supply me with a good tutorial to follow, or just give me some basic instructions? Thanks for all your guy's help in advance.

Spring can crash upon loading up a new model for several reasons:
1. You've borked the reference to the model, or the internal path to the textures in the .S3O are borked.
For example, your model is called UberCoolDroid.
In the unit .FBI, you need to have the following three lines, like this:
Name tells Spring what name to display to players via the GUI. That's all that line does. It can be anything.
UnitName tells Spring what COB animation script is being used, and is used for a wide variety of other internal references (COB ties into a bunch of things). If you aren't totally consistent about names throughout your game, then it's going to crash, basically.
ObjectName tells Spring what 3D file to load, and what type it is. However, it's a little more complicated than that. When .S3Os are loaded in Spring, they look for the texture in the \unittextures\ sub-directory. If you haven't saved that texture there, then it will crash. I've tried using sub-directories within \unittextures\, and it doesn't work as of the last time I tested, which is annoying, since any large-scale project can involve dozens and dozens of files.
Lastly, .S3Os require two textures- one for the diffuse / teamcolor map, and one for glow / reflect / 1-bit transparency. They aren't optional. And the file format of the images needs to be TGA, DDS or PNG. Preferably TGA or DDS, for completely reliable results.
2. Or, it may be something completely different. You really haven't given us enough information about the crash to judge- you may think it's the new model, but it may be lots of other crap, too- Spring's very forgiving, but there are plenty of things where if it hits a null value, it'll lock.
For all we know, it's because you've hosed a reference to a CEG, or something like that- there are a number of things like that that can cause a hard crash in 0.75b2. Using XTA's Commander, which I assumed you just ripped out and have started a new game from scratch with, is probably a bit tricky because of these issues. I'd suggest, frankly, to start with my "minimal unit" file from NanoBlobs 0.63, which you can get from unknown-files.net, and working up from there, instead of with a unit from an OTA conversion that, unless they've cleaned up their FBIs lately, is probably still full of OTA crap that doesn't work in Spring, is poorly formatted, etc., etc... better to start from the ground up, reading in the Wiki about what FBI tags do X, Y or Z, than have to work backwards from something in a finished game, frankly- you're going to miss out on a lot if you hack backwards from OTA clones.
1. You've borked the reference to the model, or the internal path to the textures in the .S3O are borked.
For example, your model is called UberCoolDroid.
In the unit .FBI, you need to have the following three lines, like this:
Code: Select all
Name=Uber Cool Droid;
UnitName=UberCoolDroid;
ObjectName=UberCoolDroid.s3o;
UnitName tells Spring what COB animation script is being used, and is used for a wide variety of other internal references (COB ties into a bunch of things). If you aren't totally consistent about names throughout your game, then it's going to crash, basically.
ObjectName tells Spring what 3D file to load, and what type it is. However, it's a little more complicated than that. When .S3Os are loaded in Spring, they look for the texture in the \unittextures\ sub-directory. If you haven't saved that texture there, then it will crash. I've tried using sub-directories within \unittextures\, and it doesn't work as of the last time I tested, which is annoying, since any large-scale project can involve dozens and dozens of files.
Lastly, .S3Os require two textures- one for the diffuse / teamcolor map, and one for glow / reflect / 1-bit transparency. They aren't optional. And the file format of the images needs to be TGA, DDS or PNG. Preferably TGA or DDS, for completely reliable results.
2. Or, it may be something completely different. You really haven't given us enough information about the crash to judge- you may think it's the new model, but it may be lots of other crap, too- Spring's very forgiving, but there are plenty of things where if it hits a null value, it'll lock.
For all we know, it's because you've hosed a reference to a CEG, or something like that- there are a number of things like that that can cause a hard crash in 0.75b2. Using XTA's Commander, which I assumed you just ripped out and have started a new game from scratch with, is probably a bit tricky because of these issues. I'd suggest, frankly, to start with my "minimal unit" file from NanoBlobs 0.63, which you can get from unknown-files.net, and working up from there, instead of with a unit from an OTA conversion that, unless they've cleaned up their FBIs lately, is probably still full of OTA crap that doesn't work in Spring, is poorly formatted, etc., etc... better to start from the ground up, reading in the Wiki about what FBI tags do X, Y or Z, than have to work backwards from something in a finished game, frankly- you're going to miss out on a lot if you hack backwards from OTA clones.
- bobthedinosaur
- Blood & Steel Developer
- Posts: 2702
- Joined: 25 Aug 2004, 13:31
can you change the damagemodifier via script? if so that cold technically achieve random like damage? just have that randomly fluctuate?
also, im trying to make a factory appear as a unit drop point, and i was wondering if i made it time limited, such as to kill the drop point after so long, could i find a way s that the killing of it due to time limit isnt registered as a kill against that play, kind of a dissolve instead? and dont just say "LUA LUA magic", unless it is only possible using lua.
also, im trying to make a factory appear as a unit drop point, and i was wondering if i made it time limited, such as to kill the drop point after so long, could i find a way s that the killing of it due to time limit isnt registered as a kill against that play, kind of a dissolve instead? and dont just say "LUA LUA magic", unless it is only possible using lua.
You can change the actual damage by returning a value different from 100 in HitByWeaponId(z,x,id,damage). You can even react to the weapon id and give different ranges for each weapon.
In SVN there's the COB value 102 now, use get KILL_UNIT(0,0,1) to delete the unit. No idea if it's considered a death though, it's a reclaim (those were counted as deaths in OTA IIRC).
In SVN there's the COB value 102 now, use get KILL_UNIT(0,0,1) to delete the unit. No idea if it's considered a death though, it's a reclaim (those were counted as deaths in OTA IIRC).
- bobthedinosaur
- Blood & Steel Developer
- Posts: 2702
- Joined: 25 Aug 2004, 13:31
- bobthedinosaur
- Blood & Steel Developer
- Posts: 2702
- Joined: 25 Aug 2004, 13:31
- bobthedinosaur
- Blood & Steel Developer
- Posts: 2702
- Joined: 25 Aug 2004, 13:31