• Hello and welcome to MSFC. We are a small and close knitted community who specialises in modding the game Star Trek Armada 2 and the Fleet Operations modification, however we have an open field for discussing a number of topics including movies, real life events and everything in-between.

    Being such a close community, we do have some restrictions, including all users required to be registered before being able to post as well as all members requiring to have participated in the community for sometime before being able to download our modding files to name the main ones. This is done for both the protection of our members and to encourage new members to get involved with the community. We also require all new registrations to first be authorised by an Administrator and to also have an active and confirmed email account.

    We have a policy of fairness and a non harassment environment, with the staff quick to act on the rare occasion of when this policy is breached. Feel free to register and join our community.

FO Weapon Conversion

Mikemckeon007

Cadet Junior
Joined
8 Feb 2020
Messages
61
Age
42
Hello Everyone,

would any of you be able to help me out with a coding issue? i have a wave weapon that when i activate it, it works fine. When the AI activates it, the game crashs. the weird part is that when i make the wave weapon not a special weapon it works fine both ways. I've pasted the contents of the 2 files in question if that helps

/////// The Weapon
//Name of the ODF file for the ordinance for this weapon
ordName = "Wjamengine"

// Mark this as a special weapon.
special = 0

//Display name for this weapon
wpnName = "Engine Jam Repulse Wave"

//tooltips
tooltip = "Engine Jam Repulse Wave"
verboseTooltip = "Knocks out enemy engines and also gives them a nice little nudge."

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

// location of the button in the popup palette
popupSlot = 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 = 1

//Time Delay between shots
shotDelay = 0

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

//Sound which is played when the weapon fires
fireSound = "swrsensf.wav"

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

//Should not be used
//wpnReticle = "gblast"

//UNKNOWN
wpnPriority = 1

//UNKNOWN
wpnCategory = "ARCA"

// HIT_EVERYONE = 0,
// HIT_ALLIES = 1,
// HIT_ENEMIES = 2
hitCondition = 2

// set wave effect
waveEffect = 1

MaxTargets = 50

// set wave name
waveName = "Wavejamengine"

//don't switch to attack mode after this
switchToAttack = 0


hotkeyLabel = "HOTKEY_F2"


////// The Ordanance File
//Programming Stuff DO NOT CHANGE
classLabel = "rfield"

//The number of units which are subtracted from the Special Energy Reserve
specialEnergyCost = 1000

//The base amount of damage which the ordinance does with each hit
damageBase = 0

//The amount of variance applied to the damage (i.e. 10 + or - 2)
damageVariance = 0

//The threshold which must be exceeded to cause crew casualties prior
//to shield exhaustion
damageThreshold = 0

//The multiplier by which any damage which exceeds the threshold is
//multiplied by to calculate the percentage of crew lost with that hit
shieldCrewModifier = 0.0

//The multiplier by which any damage which is applied to the hull is
//multiplied by to calculate the percentage of crew lost with that hit
hullCrewModifier = 0.0

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

//How fast the shot moves
shotSpeed = 150.0

// This affects the turning radius/rate somewhat unknown.
omegaTurn = 3.0

// The rate at which this Torpedo accelerates.
shotAccel = 100.0

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

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

//this modifies the color of the ordinance (not currently working)
shotColor = 227

// Size of photon torpedo.
radius = 0

// Special value for special effects
specialValue = 30

//Repulsion force
repulsionForce = 125.0f

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

Hath

The COON !!!
Leader of the Trash Panda Horde
Joined
6 Mar 2019
Messages
780
Hi Mike I glanced over your files and nothing jumped out at my as to why this isn't working. Are the files the ones that work or the ones that crash the game? Maybe you can post the other set. Did you use an existing weapon to make this one? If so which one? Is this for A2 or fleet ops? If its in fleet ops make sure that you haven't misspelled the weapon name on the next rank of the ship. I did that and it took me forever to figure it out. Are you and the computer using the same ship to activate the weapon?
 

Adm_Z

Gettin' down and GUI!
Joined
23 Nov 2009
Messages
2,745
If I remember correctly, a crash like that is usually a misspelled or non-existent reference/name. Is it possible you removed something or spelled it incorrectly in an AI ship odf? I think the AI may sometimes use different ship odf too. Or if an odf has a name that is way too long, that can cause issues too.
 

CptBenSisko

The Emissary
Joined
2 Feb 2010
Messages
611
there are some classlabels that the AI just can't use. for whatever reason. best bet would be to create two versions.. one for the AI that doesn't crash.. and one for the player to research. that way you are covered both ways
 

Mikemckeon007

Cadet Junior
Joined
8 Feb 2020
Messages
61
Age
42
Thank You everyone. the work around I used was the needs target command (needTarget = 1).
 

Mikemckeon007

Cadet Junior
Joined
8 Feb 2020
Messages
61
Age
42
there are some classlabels that the AI just can't use. for whatever reason. best bet would be to create two versions.. one for the AI that doesn't crash.. and one for the player to research. that way you are covered both ways
That sounds on point now that you say it. Thank you very much for taking the time to help me. I really appreciate it.
 

Mikemckeon007

Cadet Junior
Joined
8 Feb 2020
Messages
61
Age
42
Hi Mike I glanced over your files and nothing jumped out at my as to why this isn't working. Are the files the ones that work or the ones that crash the game? Maybe you can post the other set. Did you use an existing weapon to make this one? If so which one? Is this for A2 or fleet ops? If its in fleet ops make sure that you haven't misspelled the weapon name on the next rank of the ship. I did that and it took me forever to figure it out. Are you and the computer using the same ship to activate the weapon?
Hi Hath, the only difference between the 2 versions of the weapon is the line special = 0. in the one thats just a weapon that fires on its own it is special = 0. In the version that requires you to push the button the line is special = 1.
 

Mikemckeon007

Cadet Junior
Joined
8 Feb 2020
Messages
61
Age
42
If I remember correctly, a crash like that is usually a misspelled or non-existent reference/name. Is it possible you removed something or spelled it incorrectly in an AI ship odf? I think the AI may sometimes use different ship odf too. Or if an odf has a name that is way too long, that can cause issues too.
it's funny that you mention the long name issue. i just had that same bug today while setting up the naming for a ship. Thank you for restoring a bit of my sanity. I thought I may have been imagining it.
 
Top