To summarize, I'm trying to run a script to return a number to use with A_SetTics();
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:
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:
Class VMMelee : Weapon{//MODEL FILEprotected name ModelName;property ModelFile : ModelName;//MELEE TYPEprotected name MeleeType;property MeleeType : MeleeType;//ATTACK SPEEDprotected int AttackSpeed;property AttackSpeed : AttackSpeed;//BASE DAMAGEprotected 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 MeleeIndexint meleeIndex= (MeleeType == "Stab") ? 0 :(MeleeType == "Slash") ? 1 : 2;//CONVERT CurrentAction TO ActionIndexint actionIndex = (CurrentAction == "Idle") ? 0 :(CurrentAction == "Attack") ? 1 :(CurrentAction == "AltAttack") ? 2 : 3; //3 defines "throw"// Return the tic value based on isActionFramereturn 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}}
Statistics: Posted by milkFiend — Sun Nov 24, 2024 3:19 am