Special Weapon Problem

The best Modding forum in the Armada community, some of the best modders come here.

Moderators: thunderchero, MrVulcan

Post Reply
User avatar
MrC_921
Cadet 1st Year
Cadet 1st Year
Posts: 15
Joined: Thu Nov 02, 2006 3:00 am
Contact:

Special Weapon Problem

Post by MrC_921 » Sat Mar 12, 2011 3:12 am

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

User avatar
pepperman
Lieutenant
Lieutenant
Posts: 775
Joined: Fri Oct 17, 2003 2:00 am
Location: Cloaked in the Neutral Zone

Post by pepperman » Sat Mar 12, 2011 10:05 am

Any problems in the tech trees?

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

User avatar
MrC_921
Cadet 1st Year
Cadet 1st Year
Posts: 15
Joined: Thu Nov 02, 2006 3:00 am
Contact:

Post by MrC_921 » Sat Mar 12, 2011 2:16 pm

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. :)
http://www.youtube.com/user/MrChristianBas

Some videos of my current mod are here. However, I have since changed the name to "Dominions & Heavens"

Methos
Ensign
Ensign
Posts: 396
Joined: Fri Dec 12, 2003 3:00 am

Post by Methos » Sat Mar 12, 2011 3:27 pm

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

User avatar
Dominus_Noctis
Cadet 3rd Year
Cadet 3rd Year
Posts: 59
Joined: Mon Nov 22, 2010 3:00 am
Contact:

Post by Dominus_Noctis » Mon Mar 14, 2011 1:36 pm

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.

User avatar
MrC_921
Cadet 1st Year
Cadet 1st Year
Posts: 15
Joined: Thu Nov 02, 2006 3:00 am
Contact:

Post by MrC_921 » Mon Mar 14, 2011 3:39 pm

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
http://www.youtube.com/user/MrChristianBas

Some videos of my current mod are here. However, I have since changed the name to "Dominions & Heavens"

User avatar
Dominus_Noctis
Cadet 3rd Year
Cadet 3rd Year
Posts: 59
Joined: Mon Nov 22, 2010 3:00 am
Contact:

Post by Dominus_Noctis » Tue Mar 15, 2011 1:54 pm

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.

User avatar
MrC_921
Cadet 1st Year
Cadet 1st Year
Posts: 15
Joined: Thu Nov 02, 2006 3:00 am
Contact:

Post by MrC_921 » Wed Mar 16, 2011 1:50 pm

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.
http://www.youtube.com/user/MrChristianBas

Some videos of my current mod are here. However, I have since changed the name to "Dominions & Heavens"

User avatar
MrVulcan
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 660
Joined: Fri Apr 25, 2003 2:00 am
Location: TO CA

Post by MrVulcan » Wed Mar 16, 2011 4:30 pm

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.

Methos
Ensign
Ensign
Posts: 396
Joined: Fri Dec 12, 2003 3:00 am

Post by Methos » Sat Mar 19, 2011 12:02 am

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.

Post Reply

Who is online

Users browsing this forum: Bing [Bot]