sorry if this is a big ignorant but im pretty unskilled at modding atm,
Im trying to set the arm and core commanders (XTA) to have a weapon that unlocks at a level of experience and disactivates the old weapon.
now im guessing this is done through the scriptor but im not totally sure where to start.
ive got my hands on a copy of war evolution but its not that clear.
where do I start? any help at all would be very welcome
experience activating a weapon
Moderator: Moderators
I'm not a scripting genius but as far as I can tell War Evo does it like this:
1) It has a constantly running script checking the experience using exp = GET VETERAN_LEVEL;
2) If the experience has reached a certain level, it activates one of the upgrades by setting one of the variables to 1.
3) In the AimWeapon script, if the variable for that weapon isn't 1, it will sleep so that the weapon never fires.
1) It has a constantly running script checking the experience using exp = GET VETERAN_LEVEL;
2) If the experience has reached a certain level, it activates one of the upgrades by setting one of the variables to 1.
3) In the AimWeapon script, if the variable for that weapon isn't 1, it will sleep so that the weapon never fires.
In the AimWeaponX function use
if(value > get VETERAN_LEVEL) return 0;
for the weapon that deactivates and
if(value <= get VETERAN_LEVEL) return 0;
for the weapon that activates. Should be the first line in that function. Value is obviously the exp level at which you want the switch to occur, e.g. 100 for 1.00.
if(value > get VETERAN_LEVEL) return 0;
for the weapon that deactivates and
if(value <= get VETERAN_LEVEL) return 0;
for the weapon that activates. Should be the first line in that function. Value is obviously the exp level at which you want the switch to occur, e.g. 100 for 1.00.
- 1v0ry_k1ng
- Posts: 4656
- Joined: 10 Mar 2006, 10:24
can you explain that further? maybe give an example?
would that work?AimPrimary(heading, pitch)
{
Static_Var_13 = get VETERAN_LEVEL;
if ( Static_Var_13 > 50 )
{
return (0);
}
if( Static_Var_4 == 1 )
{
return (0);
}
signal SIG_AIM;
set-signal-mask SIG_AIM;
bAiming = TRUE;
while( !Static_Var_3 )
{
sleep 100;
}
turn torso to y-axis heading speed <300.071429>;
turn luparm to x-axis <0.000000> - pitch - <30.005495> speed <45.005495>;
wait-for-turn torso around y-axis;
wait-for-turn luparm around x-axis;
return (1);
}
I'd use a static var in the aim function instead...
Otherwise I'd perform an unecessary get each time it aims. Although it doesn't really matter that much...
Code: Select all
static-var weapon1_locked;
Create()
{
weapon1_locked = TRUE;
...
}
AimWeapon1(heading, pitch)
{
if (weapon1_locked)
{
if (get VETERAN_LEVEL > some_value) weapon1_locked = FALSE;
return FALSE;
}
else return TRUE;
}
- 1v0ry_k1ng
- Posts: 4656
- Joined: 10 Mar 2006, 10:24
tbh I only just found out that the order of the lines is important, that looks a bit beyond me
if its unclear, im attempting to bolt another hardpoint onto a commander script, in the same position as the laser weapon, and use the experince level to decide which one aims the arm and can fire.
stages to doing this:
1) figure out how to activate and disactive a weapon done
2) figure out how to add a new weapon using the script, ideally copy pasting an existing weapon and just giving it a higher number, while not breaking the script.
3) sort out which weapon aims the arm.
Im hoping there is a shoddy cut/paste solution to all of these because my coding skill is basicly negative.
How do I add a weapon to a script/what do i copy/paste ?

if its unclear, im attempting to bolt another hardpoint onto a commander script, in the same position as the laser weapon, and use the experince level to decide which one aims the arm and can fire.
stages to doing this:
1) figure out how to activate and disactive a weapon done
2) figure out how to add a new weapon using the script, ideally copy pasting an existing weapon and just giving it a higher number, while not breaking the script.
3) sort out which weapon aims the arm.
Im hoping there is a shoddy cut/paste solution to all of these because my coding skill is basicly negative.
How do I add a weapon to a script/what do i copy/paste ?
Just copypasta all those *WeaponX() functions and increase X by 1.
Also use a different signal in each AimWeaponX() function or one aim function will kill another which can prevent the unit from firing at all...
AimFromWeaponX()
AimWeaponX()
FireWeaponX()
EndBurstX() (if you happen to use that)
Did I miss one?
Also use a different signal in each AimWeaponX() function or one aim function will kill another which can prevent the unit from firing at all...
AimFromWeaponX()
AimWeaponX()
FireWeaponX()
EndBurstX() (if you happen to use that)
Did I miss one?
-
- MC: Legacy & Spring 1944 Developer
- Posts: 1948
- Joined: 21 Sep 2004, 08:25