|
 |
| Author |
Message |
|
SeptimusHeap
|
Posted: 12 May, 2012
|
|
Joined: 12 May, 2012 Posts: 24
|
|
I've just started modding FA with help from Exavier's great tutorial, but I am confused with weapon creation. I have created a Cybran T3 Decoy Missile Launcher that I want to shoot strategic missiles that do not explode but trigger defenses. What would be the best course of action?
On another not, I can't seem to find any supcom to blender conversion scripts that are still supported. Any ideas?
|
|
| Top |
|
 |
|
BulletMagnet
|
Posted: 12 May, 2012
|
|
Joined: 05 Oct, 2007 Posts: 16425 Location: camping near the biggest power-up
|
|
Just copy the blueprint and the script files of the unit, and the projectile it fires. Then edit the blueprint to reduce the weapon damage down to something very small (or zero). Then edit the projectile's blueprint and remove the detonation effects.
I think the result will be a missile that detonates (on a technical level), but doesn't do anything.
This will probably trigger the Strategic Launch Detected sound for everyone, but since you want to throw fake SMLs around I expect you'll want to keep that part too.
_________________
Nephylim wrote: But, an FA army in an FA environment just looks... right. Does anyone know how to use air transports? I cant get them to pick up troops.
|
|
| Top |
|
 |
|
SeptimusHeap
|
Posted: 13 May, 2012
|
|
Joined: 12 May, 2012 Posts: 24
|
BulletMagnet wrote: Just copy the blueprint and the script files of the unit, and the projectile it fires. Then edit the blueprint to reduce the weapon damage down to something very small (or zero). Then edit the projectile's blueprint and remove the detonation effects.
I think the result will be a missile that detonates (on a technical level), but doesn't do anything.
This will probably trigger the Strategic Launch Detected sound for everyone, but since you want to throw fake SMLs around I expect you'll want to keep that part too. Thanks! I'm confused about how to go about creating a new weapon/projectile, do you know of any other good guides? I can't understand Exavier's projectile tutorial.
|
|
| Top |
|
 |
|
BulletMagnet
|
Posted: 13 May, 2012
|
|
Joined: 05 Oct, 2007 Posts: 16425 Location: camping near the biggest power-up
|
|
Exavier's is pretty much the best guide to be found. That said, I don't recall the projectile part of it.
Creating a new weapon (in your case) is as easy as copying the blueprint and script files for a standard SML, and giving it a new UnitId. Creating a new projectile works the same way, though you will have to tweak your new unit so that it wants to fire new projectiles instead of old ones.
From memory, I remember that a weapon blueprint has a file address that points to the projectile to fire. Find things that look like filenames, and go hunting!
_________________
Nephylim wrote: But, an FA army in an FA environment just looks... right. Does anyone know how to use air transports? I cant get them to pick up troops.
|
|
| Top |
|
 |
|
SeptimusHeap
|
Posted: 15 May, 2012
|
|
Joined: 12 May, 2012 Posts: 24
|
BulletMagnet wrote: Exavier's is pretty much the best guide to be found. That said, I don't recall the projectile part of it.
Creating a new weapon (in your case) is as easy as copying the blueprint and script files for a standard SML, and giving it a new UnitId. Creating a new projectile works the same way, though you will have to tweak your new unit so that it wants to fire new projectiles instead of old ones.
From memory, I remember that a weapon blueprint has a file address that points to the projectile to fire. Find things that look like filenames, and go hunting! I was able to add a new missile, but when I select the building, the green footprint shows up, but when I click, the unit doesn't build it. Any ideas? Also, if you need to see the bp or lua, I can post it.
|
|
| Top |
|
 |
|
BulletMagnet
|
Posted: 15 May, 2012
|
|
Joined: 05 Oct, 2007 Posts: 16425 Location: camping near the biggest power-up
|
|
Post it on pastebin.com, then share the links here. Someone should be able to spot a problem with it.
_________________
Nephylim wrote: But, an FA army in an FA environment just looks... right. Does anyone know how to use air transports? I cant get them to pick up troops.
|
|
| Top |
|
 |
|
BulletMagnet
|
Posted: 16 May, 2012
|
|
Joined: 05 Oct, 2007 Posts: 16425 Location: camping near the biggest power-up
|
Code: URB2305 = Class(CStructureUnit) { Weapons = { NukeMissiles = Class(CIFMissileStrategicWeapon) {}, }, } TypeClass = SRB4001 First line - you've forgotten to change that to SRB4001. You blueprint file looks right; it's got a new projectile listed there, and I can't see any obvious faults.
_________________
Nephylim wrote: But, an FA army in an FA environment just looks... right. Does anyone know how to use air transports? I cant get them to pick up troops.
|
|
| Top |
|
 |
|
SeptimusHeap
|
Posted: 16 May, 2012
|
|
Joined: 12 May, 2012 Posts: 24
|
Still doesn't work 
|
|
| Top |
|
 |
|
Domino
|
Posted: 16 May, 2012
|
|
Joined: 26 Feb, 2009 Posts: 2996
|
|
Hi,
the projectile will need the path to your mod added also if its not a default game projectile, i dont think thats the reason your unit isnt showing up though.
i cant see anything wrong with either script of bp.. apart from what bm pointed out and the projectile path.
_________________ Domino. ______________
|
|
| Top |
|
 |
|
SeptimusHeap
|
Posted: 16 May, 2012
|
|
Joined: 12 May, 2012 Posts: 24
|
Domino wrote: Hi,
the projectile will need the path to your mod added also if its not a default game projectile, i dont think thats the reason your unit isnt showing up though.
i cant see anything wrong with either script of bp.. apart from what bm pointed out and the projectile path. What do you mean about the path? I don't understand. Also, it works after I restarted. Now it just says missiles 0/0 and will not produce any.
|
|
| Top |
|
 |
|
Domino
|
Posted: 16 May, 2012
|
|
Joined: 26 Feb, 2009 Posts: 2996
|
|
the projectile path for the weapon, if its not a default hooked projectile, you will have supply the full path to the projectile,
'/mods/experimentals/projectiles/SRBFluxWarhead01/SRBFluxWarhead01_proj.bp',
instead of the partail path or else your projectile wont be found.
we only supply a partail path IF the projectile is a hooked projectile in which case the path would be a partail path and the projectile would be in your mods /hook/projectiles/blah path, or if the mod is in .scd form it could just go in /projectiles/blah/
seeing as this is a mod and if the projectile is a custom projectile then you have to supply the full path from '/mods/yourmodname/pathtoprojectile/'
_________________ Domino. ______________
|
|
| Top |
|
 |
|
SeptimusHeap
|
Posted: 16 May, 2012
|
|
Joined: 12 May, 2012 Posts: 24
|
Thanks! Now when it shoots, the missiles stop in midair for some reason! Could anyone see if they could find a problem in the bp or lua?
|
|
| Top |
|
 |
|
BulletMagnet
|
Posted: 16 May, 2012
|
|
Joined: 05 Oct, 2007 Posts: 16425 Location: camping near the biggest power-up
|
|
Where in the air do they stop? That should hint at where the problem is.
_________________
Nephylim wrote: But, an FA army in an FA environment just looks... right. Does anyone know how to use air transports? I cant get them to pick up troops.
|
|
| Top |
|
 |
|
SeptimusHeap
|
Posted: 17 May, 2012
|
|
Joined: 12 May, 2012 Posts: 24
|
BulletMagnet wrote: Where in the air do they stop? That should hint at where the problem is. I cant tell very well as they're nukes, but they fly up and then start flying down when they stop about halfway.
|
|
| Top |
|
 |
|
Lt_hawkeye
|
Posted: 17 May, 2012
|
|
Joined: 26 Mar, 2007 Posts: 5075 Location: California, United States
|
|
sounds like the projectile is dying before it has a chance to reach the target, try checking the Projectile Lifetime(either in the projectile BP or weapon BP)
_________________ {◕ ◡ ◕}
|
|
| Top |
|
 |
|
SeptimusHeap
|
Posted: 17 May, 2012
|
|
Joined: 12 May, 2012 Posts: 24
|
Lt_hawkeye wrote: sounds like the projectile is dying before it has a chance to reach the target, try checking the Projectile Lifetime(either in the projectile BP or weapon BP) It doesn't disappear, just stops. Unless it does disappear and the nuke symbol stays?
|
|
| Top |
|
 |
|
Exavier Macbeth
|
Posted: 17 May, 2012
|
|
| Forum Scout |
 |
Joined: 16 Feb, 2007 Posts: 2839 Location: Phoenix, Arizona, USA
|
Any errors in the log? Usually when something gets stuck like it sounds like this is its because the script failed. Though I am not sure off hand what would cause a projectile to just freeze in place mid flight. You might wana try modifying line 64 in your script (at least the script you posted above), the first WaitSeconds in the movement thread, to a lower value. Not permenantly but just temporarily set it to something like 0.2. This will allow the missile to start heading for its leveled out flight path closer to the ground... should make it easier to keep it on camera so you can see if it is doing something funny 
|
|
| Top |
|
 |
|
SeptimusHeap
|
Posted: 18 May, 2012
|
|
Joined: 12 May, 2012 Posts: 24
|
Exavier Macbeth wrote: Any errors in the log? Usually when something gets stuck like it sounds like this is its because the script failed. Though I am not sure off hand what would cause a projectile to just freeze in place mid flight. You might wana try modifying line 64 in your script (at least the script you posted above), the first WaitSeconds in the movement thread, to a lower value. Not permenantly but just temporarily set it to something like 0.2. This will allow the missile to start heading for its leveled out flight path closer to the ground... should make it easier to keep it on camera so you can see if it is doing something funny  The projectile still seems to fly especially high before coming down... And then it just slows to a crawl and stops. Also, your guide is great! Thank you for writing it! It has really helped me. Edit: AHA! Here we are: Code: DEBUG: Loading module '\000/mods/experimentals/projectiles/srbfluxwarhead01/srbfluxwarhead01_script.lua\000' DEBUG: Loading module '\000/lua/cybranprojectiles.lua\000' WARNING: ...ectiles\srbfluxwarhead01\srbfluxwarhead01_script.lua(4): access to nonexistent global variable "SRBFluxWarheadProjectile" WARNING: stack traceback: WARNING: [C]: in function `error' WARNING: ...alliance\gamedata\mohodata.scd\lua\system\config.lua(53): in function <...alliance\gamedata\mohodata.scd\lua\system\config.lua:52> WARNING: ...ectiles\srbfluxwarhead01\srbfluxwarhead01_script.lua(4): in main chunk WARNING: [C]: in function `doscript' WARNING: [C]: in function `pcall' WARNING: ...alliance\gamedata\mohodata.scd\lua\system\import.lua(48): in function `import' WARNING: Error importing /mods/experimentals/projectiles/srbfluxwarhead01/srbfluxwarhead01_script.lua: Error importing '/mods/experimentals/projectiles/srbfluxwarhead01/srbfluxwarhead01_script.lua' stack traceback: [C]: in function `error' ...alliance\gamedata\mohodata.scd\lua\system\import.lua(52): in function `import' INFO: Problems loading module '/mods/experimentals/projectiles/srbfluxwarhead01/srbfluxwarhead01_script.lua'. Falling back to 'Projectile' in '/lua/sim/projectile.lua'. I can't seem to tell what's wrong, but there's the error.
|
|
| Top |
|
 |
|
Exavier Macbeth
|
Posted: 18 May, 2012
|
|
| Forum Scout |
 |
Joined: 16 Feb, 2007 Posts: 2839 Location: Phoenix, Arizona, USA
|
SeptimusHeap wrote: Code: WARNING: ...ectiles\srbfluxwarhead01\srbfluxwarhead01_script.lua(4): access to nonexistent global variable "SRBFluxWarheadProjectile" I can't seem to tell what's wrong, but there's the error. This line of your script is failing... local SRBFluxWarheadProjectile = import('/lua/cybranprojectiles.lua').SRBFluxWarheadProjectile Spelling mistake possibly? Which would make sense for what your projectile is doing since the rest of the script (including the flight controls) don't load. Btw if you look at the error you will see a (4) after the filename that errored. Thats the line number where the error occured. For custom files it should usually match up exactly (including commented lines) and for hooked files it shows up as the line number in your file plus the original files total line number. EDIT: Glad you liked the tutorial. I generally hate writing them which is why I have never finished the rewrite of it to clean it up a bit. I have a partial rewrite somewhere but its only partially through weapon creation so doesn't help here 
|
|
| Top |
|
 |
|
SeptimusHeap
|
Posted: 18 May, 2012
|
|
Joined: 12 May, 2012 Posts: 24
|
Exavier Macbeth wrote: SeptimusHeap wrote: Code: WARNING: ...ectiles\srbfluxwarhead01\srbfluxwarhead01_script.lua(4): access to nonexistent global variable "SRBFluxWarheadProjectile" I can't seem to tell what's wrong, but there's the error. This line of your script is failing... local SRBFluxWarheadProjectile = import('/lua/cybranprojectiles.lua').SRBFluxWarheadProjectile Spelling mistake possibly? Which would make sense for what your projectile is doing since the rest of the script (including the flight controls) don't load. Btw if you look at the error you will see a (4) after the filename that errored. Thats the line number where the error occured. For custom files it should usually match up exactly (including commented lines) and for hooked files it shows up as the line number in your file plus the original files total line number. EDIT: Glad you liked the tutorial. I generally hate writing them which is why I have never finished the rewrite of it to clean it up a bit. I have a partial rewrite somewhere but its only partially through weapon creation so doesn't help here  Must I edit the cybran projectiles .lua file to add a new projectile?
|
|
| Top |
|
 |
|
Exavier Macbeth
|
Posted: 18 May, 2012
|
|
| Forum Scout |
 |
Joined: 16 Feb, 2007 Posts: 2839 Location: Phoenix, Arizona, USA
|
|
not really no. But you do need to make sure that the spelling of everything matches up & that its calling the files properly.
For example: import('/lua/cybranprojectiles.lua').SRBFluxWarheadProjectile this is trying to import the contents of the "SRBFluxWarheadProjectile" section in the "/lua/cybranprojectiles.lua" file. The error your getting is that it couldn't find it so couldn't build the global variable. Two things would be to make sure "SRBFluxWarheadProjectile" exists in that file or that the file name/path its looking for is correct.
If that value is a custom one, possibly because you set up your own effects for the projectiles detonation, then you will need to either add it into that file or do something like what Blackops does (which I believe was in my guide) and create your own version of the customprojectiles.lua, reference it, and put your custom data into it.
If that value is just an existing entry, possibly just reusing GPG default effects while learning, then you need to make sure the file path is correct & being loaded properly.
|
|
| Top |
|
 |
|
SeptimusHeap
|
Posted: 18 May, 2012
|
|
Joined: 12 May, 2012 Posts: 24
|
Exavier Macbeth wrote: not really no. But you do need to make sure that the spelling of everything matches up & that its calling the files properly.
For example: import('/lua/cybranprojectiles.lua').SRBFluxWarheadProjectile this is trying to import the contents of the "SRBFluxWarheadProjectile" section in the "/lua/cybranprojectiles.lua" file. The error your getting is that it couldn't find it so couldn't build the global variable. Two things would be to make sure "SRBFluxWarheadProjectile" exists in that file or that the file name/path its looking for is correct.
If that value is a custom one, possibly because you set up your own effects for the projectiles detonation, then you will need to either add it into that file or do something like what Blackops does (which I believe was in my guide) and create your own version of the customprojectiles.lua, reference it, and put your custom data into it.
If that value is just an existing entry, possibly just reusing GPG default effects while learning, then you need to make sure the file path is correct & being loaded properly. Thank you so much! Sorry I'm so clueless I just have a few more questions of opinion: Do you think the decoy should have a mediocre explosion or none at all? I'm thinking that the build time should be slightly less per missile than missile defense, what do you think? Do you know of any modelers that would be willing to make me a model?
|
|
| Top |
|
 |
|
Exavier Macbeth
|
Posted: 18 May, 2012
|
|
| Forum Scout |
 |
Joined: 16 Feb, 2007 Posts: 2839 Location: Phoenix, Arizona, USA
|
Everyone has to start somewhere  As for the first 2 questions thats really a balance consideration that you have to decide on your own. Effects wise I dout an explosion would matter since most SMD intercepts happen out of camera range anyway. Build time depends on what you have in mind for the function. Is it going to be designed to just let players fire them and empty out enemy silos? or maybe force the player to build a couple of these launchers, and probobly much cheaper missiles compared to nukes, per nuke. That way they fire them all at once in hopes the SMDs take out the decoys and not the dangerous warhead  As to a modeler... I wouldn't have a clue. I personally have relied on Knight who is on our team so much I really don't track who else can make models in the community anymore.
|
|
| Top |
|
 |
|
SeptimusHeap
|
Posted: 18 May, 2012
|
|
Joined: 12 May, 2012 Posts: 24
|
Exavier Macbeth wrote: Everyone has to start somewhere  As for the first 2 questions thats really a balance consideration that you have to decide on your own. Effects wise I dout an explosion would matter since most SMD intercepts happen out of camera range anyway. Build time depends on what you have in mind for the function. Is it going to be designed to just let players fire them and empty out enemy silos? or maybe force the player to build a couple of these launchers, and probobly much cheaper missiles compared to nukes, per nuke. That way they fire them all at once in hopes the SMDs take out the decoys and not the dangerous warhead  As to a modeler... I wouldn't have a clue. I personally have relied on Knight who is on our team so much I really don't track who else can make models in the community anymore. Yeah, I think the decoys would add a lot of strategy options as far as nuking goes. They could be used to scare your opponent into wasting resources into building defense, they could be used to drain SMDs, or to escort warheads. Also, how would I add an effect similar to a plane crash where the fake nuke lands?
|
|
| Top |
|
 |
 |
 |
|