If someone has an updated version (bugfree) can post it here.
1.It dont see anywhere in it saveattributes and loadatributes commands to save the state of the player between levels.
How nobody needed that?
2.And,i remember an old one that had some problems with inverted movement of the invisible standard player.
3.Also,can someone remind me how you use the script?Add a pawn with name "player" and add a player pawn to the pawn.ini?
4.If that s it,how do you define more than one players in the pawn.ini?
5.Is there a way to script character selection for players that use script like the genericplayer.s?
6.If there is a way,then for each level do you have to add one playersetup and playerstart,and all-14-for example pawns that will be the players?
Code: Select all
{
FIREAMMO [pistolbullet] // Projectile fired by pawn
FIREEFFECT [Electric] // muzzleflash effect
WEAPONMODEL [Laser] // Weapon held by pawn
FIRERATE [0.1] // Weapon firing rate
GROUP [Friendly] // Pawn Group - must be targetted by enemies
PLAYERSPEED [96] // Walk Speed
HEALTHATTRIB [health] // health attribute given to pawn
HEALTHAMOUNT [500] // amount of health given to pawn
DAMAGEATTRIB [health] // Atribute damaged by pawn
BOX [24] // Box width
IDLEANIM [recon_idle] // Idle AnimationSpeed
SHOOTANIM [recon_shoot] // Shoot anim
WALKANIM [recon_walk] // Walk anim
BACKANIM [recon_walk_back] // Walk back anim
STRAFELEFT [recon_strafe_left] // Strafe left anim
STRAFERIGHT [recon_strafe_right] // Strafe right anim
INTERANIM [recon_strike] // Pawn interact anim
DEATHANIM [recon_die] // Death Anim
ROOTBONE [Bip01] // Pawn root bone
WEAPONHAND [Bip01 L Hand] // Pawn weapon bone
K_INTER [73] // INTERACT KEY - RIGHT MOUSE
K_FIRE [72] // FIRE KEY - LEFT MOUSE
K_FOR [15] // FORWARD - W
K_BAK [27] // BACK - S
K_LEFT [26] // STRAFE LEFT - A
K_RIGHT [28] // STRAFE RIGHT - D
K_RUN [36] // RUN - LEFT SHIFT KEY
ANIM [string] // Do Not Edit
ANC [0] // Do Not Edit
LASTANC [0] // Do Not Edit
DIR [0] // Do Not Edit
AT [0.5] // Do Not Edit
INTER [string] // Do Not Edit
TM [0] // Do Not Edit
SPEED [0] // Do Not Edit
Spawn[()
{
Console(false);
BoxWidth(BOX);
SetGroup(GROUP);
AttributeOrder(HEALTHATTRIB, HEALTHAMOUNT, "Die");
SetWeapon(WEAPONMODEL);
LowLevel("Setup");
}]
Setup[()
{
AttachCamera();
self.yaw_speed=256;
AnimateHold(IDLEANIM);
ANIM=StringCopy(IDLEANIM);
ANC=0;
LASTANC=0;
TM=self.time;
self.think="RunPlayer";
}]
RunPlayer[()
{
//debug(self.key_pressed);
PlayerRender(false);
self.ideal_yaw=self.player_yaw;
ChangeYaw();
DIR=0; // Default straight
SPEED=0; // Default - no motion
AT=0.1; // Default
ANC=0; // Default
AnimationSpeed(1); // Default
// handle health status
if(self.health < 1)
{
HighLevel("Die");
return 0;
}
// handle controls
if(IsKeyDown(K_INTER))
{
//strike/interact
AnimateBlend(INTERANIM, 0.25);
self.think="Interact";
return 0;
}
if(IsKeyDown(K_FOR))
{
// forward
ANIM=StringCopy(WALKANIM);
ANC=2;
SPEED=Integer(PLAYERSPEED);
}
if(IsKeyDown(K_BAK))
{
// back
ANIM=StringCopy(BACKANIM);
ANC=3;
DIR=ConvertDegrees(180);
SPEED=Integer(PLAYERSPEED);
}
if(IsKeyDown(K_LEFT))
{
// strafe left
ANIM=StringCopy(STRAFELEFT);
// make strafe transition smoother
AT=0.5;
ANC=4;
DIR=ConvertDegrees(90);
SPEED=Integer(PLAYERSPEED);
}
if(IsKeyDown(K_RIGHT))
{
// strafe right
ANIM=StringCopy(STRAFERIGHT);
// make strafe transition smoother
AT=0.5;
ANC=5;
DIR=ConvertDegrees(270);
SPEED=Integer(PLAYERSPEED);
}
if(IsKeyDown(K_FIRE))
{
// fire
if(ANC < 1)
{
//only go to shoot anim if at idle
ANIM=StringCopy(SHOOTANIM);
ANC=1;
}
// Check fire rate
if(self.time > TM+FIRERATE)
{
TM=self.time;
FireProjectileBlind(FIREAMMO, WEAPONHAND, 0, 0, 0, DAMAGEATTRIB);
AddExplosion(FIREEFFECT, WEAPONHAND, 0, 0, 0);
TM=self.time;
}
}
if(ANC < 1)
{
//no button
ANIM=StringCopy(IDLEANIM);
AT=0.5;
}
if(IsKeyDown(K_RUN))
{
//left shift key - toggle run
AnimationSpeed(1.5);
SPEED=SPEED+(SPEED/2);
}
//handle animations
if(Integer(LASTANC) != Integer(ANC))
{
AnimateBlend(ANIM,AT);
}
LASTANC=Integer(ANC);
if(self.animate_at_end)
{
AnimateHold(ANIM);
}
//handle motions
walkmove(self.current_yaw+DIR,SPEED);
}]
Interact[()
{
if(self.animate_at_end)
{
INTER=TraceToActor(ROOTBONE, 0, 0, 32);
if(INTER != "FALSE")
{
SetEventState(INTER # "Trigger", true);
}
self.think="RunPlayer";
return 0;
}
}]
Die[()
{
AnimateStop(DEATHANIM, 0, "");
}]
}