Page 1 of 1

Special Weapon Problem

Posted: Sat Mar 12, 2011 3:12 am
by MrC_921
Hello everybody,

I am having a problem with a special weapon in my mod. The weapon is meant to be somewhat like Borg Adaption. I call this weapon "Shield Overcurrent." When activated, Shield Overcurrent makes the equipped ship invincible for a short time. So, in essence, Shield Overcurrent is a self-targeting Shield Remodulation.

That's not the problem. The weapon works perfectly ingame. But now I am working with AI, and this AI builds ships equipped with Shield Overcurrent. A while after some of these ships are built, the game will crash. As an experiment I removed the AI's ability to use Shield Overcurrent, and the game did not crash.

Here is the .odf file for Shield Overcurrent:

------------------------------- CODE BEGINS HERE ------------------------

//Display name for this weapon
wpnName = "Shield Overcurrent"
tooltip = "Shield Overcurrent (^F^3)"
verboseTooltip = "Overloads the Charon's shield emitters for a short time. During this overload, the shields are virtually impenetrable."

//Name of the ODF file for the ordinance for this weapon
ordName = "TShdOvro"

//Location of the button in the speed panel
buttonSlot = 3

// Priority of button in the speed panel, this is only
// used if it is non-zero.
buttonPriority = 10

//Type of border to use for this button.
//0 = No border.
//1 = Offensive border.
//2 = Defensive border.
buttonBorder = 0

// Special stuff - denote special weapon
special = 1

//Time Delay between shots - not used
shotDelay = 20

// Range within which the weapon will fire (Not used)
range = 70.0f

//Sound which is played when the weapon fires - temp sound
fireSound = "swbsremf.wav"

// Chance of hitting the target. - not used
hitChance = 1.00

// Don't shoot my own guys.
beneficial = 1

//ship shouldn't automatically switch to attack mode after using this "weapon"
switchToAttack = 0

//Programming Stuff DO NOT CHANGE
classLabel = "toggleweapon"
//classLabel = "remodulation"

//Should not be used
wpnReticle = "gblast"

//UNKNOWN
wpnPriority = 0

//UNKNOWN
wpnCategory = "TOWE"
------------------------------- CODE ENDS HERE ------------------------

Only the classLabel = "toggleweapon" seems to work; I tried "remodulation" but that didn't work. I am not sure what other classlabels would work - maybe "cannon?"

My question is, why would the weapon cause the AI to crash, when I as a player can use it perfectly fine? This is confusing me, and I would like the AI to be able to use this weapon! :P Any help would be appreciated! :D

Cheers,
MrC

Posted: Sat Mar 12, 2011 10:05 am
by pepperman
Any problems in the tech trees?

I would give cannon or areacannon a try to see if either of them work manually.

Posted: Sat Mar 12, 2011 2:16 pm
by MrC_921
No, I don't think there are any techtree problems. The AI seemed to go through the complete buildlist with no hitches. But I can have another look to make sure.

Thanks, I can give those other classlables a try. :)

Posted: Sat Mar 12, 2011 3:27 pm
by Methos
Toggle works fine. Think it's your border


Here's a copy of the one I use,AI has no probs using it or crashes.


//Display name for this weapon
wpnName = "Shield Remodulation"

//tooltips Reinforce shield grid
tooltip = "BORG_POD6"
verboseTooltip = "BORG_POD6_V"

//Name of the ODF file for the ordinance for this weapon
ordName = "selfreod"

//Location of the button in the speed panel
buttonSlot = 1

// location of the button in the popup palette
popupSlot = 7

// Priority of button in the speed panel, this is only
// used if it is non-zero.
buttonPriority = 5

//Type of border to use for this button.
//0 = No border.
//1 = Offensive border.
//2 = Defensive border.
buttonBorder = 2

// Special stuff - denote special weapon
special = 1

//Time Delay between shots - not used
shotDelay = 3.5

// Range within which the weapon will fire.
range = 100.0f

//Sound which is played when the weapon fires - temp sound
fireSound = "swbsremf.wav"

beneficial = 1

classLabel = "toggleweapon"


//ship shouldn't automatically switch to attack mode after using this "weapon"
switchToAttack = 0

// Chance of hitting the target. - not used
hitChance = 1.00

// Don't shoot my own guys.
beneficial = 1

//this special weapon can be assimilated by the borg tech assimilator
//assimilatable = "borpod6"

hotkeyLabel = "HOTKEY_F9"


***********


//Programming Stuff DO NOT CHANGE
classLabel = "remodulation"

//Amount of time the ordinance will exists without hitting something
lifeSpan = 1.0

//Length of the shield hit animation.
shieldDuration = 1.0

//How fast the shot moves
shotSpeed = 1e6

//The sprite which is used for this ordinance
Sprite = "wmanheim"

//Phaser specific: this modifies the color of the phaser
shotColor = 227

//Phaser specific: this is the thickness of the beam
Radius = 8.0

// Time to play through the animation for the sprite in seconds
spriteDuration = 1.0

// life span of the shield effect
specialValue = 20.0

// Cost of shield remodulation
specialEnergyCost = 600

// The sound of the ordinance hitting the Target
hitSound = "swbsremx.wav"

// No need to create a shield hit
ignoreShield = 1

Posted: Mon Mar 14, 2011 1:36 pm
by Dominus_Noctis
Hm, as near as I recall, remodulation cannot be self targeted for the AI because most AI special weapons need to designate a target in Stock Armada II.

Likewise, a few points:

ButtonBorder, WpnPriority, WpnCategory, and PopUpSlot are NOT commands in Armada II (and all but ButtonBorder are not commands in Armada I either), so you can totally leave them out, and there won't be an effect anyway.

Posted: Mon Mar 14, 2011 3:39 pm
by MrC_921
Thanks for the suggestions, guys. This weapon is for Armada 1. Is there a difference between the ways A1 and A2 deal with these kinds of weapons?

I tried changing the buttonBorder value to 2. That did not work; the game still crashed.

I am not sure if this would cause a problem, but I recently reformated my computer and installed Windows Vista. I have not gotten a lot of the later Windows updates; this wouldn't be causing Armada problems, would it?

Cheers,
MrC

Posted: Tue Mar 15, 2011 1:54 pm
by Dominus_Noctis
Unfortunately I believe both A2 and A1 deal with self targeted weapons for the AI in the same way - thus, remodulation not having a target for the AI should cause a crash.

Posted: Wed Mar 16, 2011 1:50 pm
by MrC_921
Yeah, I'm just wondering why the same things works for Methos just fine and not for my version? It looks like the only difference between Methos' version and mine is that mine is in A1.

Posted: Wed Mar 16, 2011 4:30 pm
by MrVulcan
What if you add the target location line?

needTarget = 1
targetLocation = 1

Haven't tried it, so can't say if that'll help.
The other line to try is:

AItargetLocation = 1

If that doesn't work, you can try reworking this to use the uball. That is, copy over the ulitrium ball weapon, but give the uball object your remodulation weapon. Hopefully it'll try to target the ship that created it.

Posted: Sat Mar 19, 2011 12:02 am
by Methos
MrC_921 wrote:Yeah, I'm just wondering why the same things works for Methos just fine and not for my version? It looks like the only difference between Methos' version and mine is that mine is in A1.

I use the Vanilla Ulimate Mod if that helps.