Replaceweapon doesn't replace

I want my 15 rapid-fire quantum torpedo launchers Uber-Defiant now! - Get help from modders. Share your work. Discuss modifications.
1, 2
posted on August 21st, 2013, 6:47 am
Yeah, I'm checking them time to time, but fletops code sometimes is a real pain in the bottom to understand, and I'm only learning the weapons. It's not so oversimplified as Armada II was :sweatdrop:
And sometimes I'm just throwing around ideas, see what happens if I do this or that and later forgot to delete it. Sometimes it later expands to other files unfortunately :)
Errors fixed, but it didn't solve the issue.
The uball is dropped by an untargetable and unselectable pod, which in fact has a classlabel of a starbase.
posted on August 21st, 2013, 3:56 pm
The classlabel doesn't matter here, but the Team does - if the Team spawning your uball is neutral, that hitmode won't hit anything.

In any case, the best way to debug this is to add animations/sod/sprite to each of your files. I.e. check that your ships are getting an extraweapon, check that the weapon is shooting them, etc. Currently you appear to have turned off some of that debugging support (showeffecticon = 0 for instance). Also, don't know what your ordnance file looks like (fedW_extraweapon1o), so hard to debug something which I can't even see :blush: .
posted on August 21st, 2013, 4:59 pm
Any team you may choose starts with its own pod which drops the uball. So the uball that supposed to add extraweapon to the player's ships is dropped by a pod owned by the player.

Here is the ordnance file:
classlabel = "unibeam"
sprite = "weapon_phaser"
radius = 12
flareradiusmultiplier = 1
flaresprite = "weapon_phaserflare"
lifespan = 0.99
shotspeed = 1e6
spriteduration = 0.5
shieldduration = 1.0
explosionhit = "fedW_phaserH"
explosionshieldhit = "fedW_phaserH"
damagebase = 0
damagevariance = 0
damagethreshold = 0
shieldcrewmodifier = 0
hullcrewmodifier = 0

It supposed to look like a phaser beam, but there is no beam at all ATM.
And I didn't even know that there was any debugging support other than the CTD log (which is quite useful).
posted on August 22nd, 2013, 1:49 am
No, there are no other debugging tools per se - but you can debug by changing various commands to show in game what is the issue :).

For instance, changing the valid targets to allow all, etc.


I don't see any explicit reason for the failure of the weapon in the ordnance or weapon commands, but there are some things you could try:

1. Have your uball use a different hardpoint. "root" is good to use, as that's usually the default
2. remove targetLoop (it's not doing anything useful there, as you haven't changed useprimarytarget command) and change hitmode to = 6. I doubt you want to hit all your allies.
3. Make sure in map editor that your uball is spawned as the correct team

I assume in all this that you've checked that all your other entries are valid (like the names of various entries or of the files etc)
posted on August 22nd, 2013, 7:14 am
I made the changes you were suggesting. But nothing changed.
I'm testing this weapon in instant action already so different teams shouldn't be a problem. But I tested it now in the mapeditor as well, and nothing happened.

I know it's noobish to ask this, but could you write these ODFs for me? :sweatdrop: An uball, an extraweapon with ordnance which can hit all my ships or stations wherever they are and even if they're cloaked, but only recognizes those ships I listed as valid targets. I'm stuck with this issue for a month now, and my modding morale is dangerously shrinking. Something's obviously wrong with my code but I can't figure it out...
posted on August 22nd, 2013, 5:10 pm
Ok, I can cobble something together for you later today, but I don't see how what I do will change much :sweatdrop:
posted on August 22nd, 2013, 5:25 pm
Attached; fed upgrader needs to be in techtree, possibly the other file too.

KmerseWep.zip
(2.15 KiB) Downloaded 290 times
posted on August 24th, 2013, 6:57 am
Yup, you were right. Using your files the Uball is dropped just like before, and the weapon doesn't fire just like before... :blink:
So I presume this means there is an issue on the game's side and something not works as designed (?)
posted on August 24th, 2013, 8:14 pm
Nope, not a game issue unfortunately - I tested these files out and they replaced things correctly. We also use some similar functions in our next version as well.
posted on August 25th, 2013, 6:45 am
I dug deeper into the issue and I managed to make it work on ships, but it doesn't work on construction ships and stations. Is this already WAD or should I continue to look for an issue? :)
posted on August 26th, 2013, 5:38 pm
Yes, the weapon will work just fine on construction ships and stations as well, so there is another bug unfortunately in your setup.
posted on August 27th, 2013, 7:31 am
I tracked down the issue. Apparently everything has to have a weapon otherwise it cannot be replaced. So I added a dummyweapon to the stations and now everything works. Finally :sweatdrop:
posted on August 27th, 2013, 4:10 pm
Ah yes, I'm sorry I failed to mention that - one of those nasty workarounds that's so common with the more complicated mechanics :sweatdrop:
1, 2
Reply

Who is online

Users browsing this forum: No registered users and 5 guests