However, whenever I run it in gzdoom, I get the error message:
"GUnexpected '{' Expecting '-' or '+' or '++' or '--' or '(' or identifier or string constant or integer constant or 'super' or '~' or '!' or 'sizeof' or 'alignof' or unsigned constant or float constant or name constant or 'false' or 'true' or 'null'"
I think this tells me that there's something wrong with my formatting or maybe that I can't set an array where I'm trying to set it.
The code used is as follows:
Code: Select all
Class VMMelee : Weapon
{
//MODEL FILE
protected name ModelName;
property ModelFile : ModelName;
//MELEE TYPE
protected name MeleeType;
property MeleeType : MeleeType;
//ATTACK SPEED
protected int AttackSpeed;
property AttackSpeed : AttackSpeed;
//BASE DAMAGE
protected int AttackPower;
property AttackPower : AttackPower;
int GetProperTics(string MeleeType, name CurrentAction, bool isActionFrame)
{
// FrameCount[numberOfMeleeTypes][numberOfActionTypes][Action/EndFrame]
int FrameCount[2][4][2] = {
//Stab
{ // !!! !!!THIS IS THE LINE CALLED IN THE ERROR MESSAGE!!! !!! \\
{57, 57}, //Idle, 57 total
{10, 13}, //Attack, 23 total
{16, 25}, //AltAttack, 41 total
{0, 0} //Throw, 0 total
},
//Slash
{
{57, 57}, //Idle, 57 total
{7, 4}, //Attack, 11 total
{21, 5}, //AltAttack, 26 total
{18, 6} //Throw, 24 total
}
};
//CONVERT MeleeType TO MeleeIndex
int meleeIndex= (MeleeType == "Stab") ? 0 :
(MeleeType == "Slash") ? 1 : 2;
//CONVERT CurrentAction TO ActionIndex
int actionIndex = (CurrentAction == "Idle") ? 0 :
(CurrentAction == "Attack") ? 1 :
(CurrentAction == "AltAttack") ? 2 : 3; //3 defines "throw"
// Return the tic value based on isActionFrame
return FrameCount[meleeIndex][actionIndex][isActionFrame ? 1 : 0];
}
Default
{
VMMelee.ModelFile 'vm_arms.iqm';
VMMelee.MeleeType 'Slash';
VMMelee.AttackPower 5;
VMMelee.AttackSpeed 1;
+DECOUPLEDANIMATIONS
+WEAPON.CHEATNOTWEAPON
}
States
{
//Omitted the states for the sake of brevity
}
}