My God, Jay!
Your signature line has never been more true, I do think.
All that stress and worry because of a capital letter(!).
Thank you so much.
But there are still things I need help with. After, finally, getting the 'genericplayer.s' scrpt to work I noticed that my character wasn't animated whilst moving. Nor could he jump. I reviewed the script and changed the noted animations to the correct ones. Then I had when play-testing, a moveable, animated character that still could no jump and run. Also, the weapon I make for him was floating in an odd place. I think its because the original playe is invisible as he should be but is still holding the weapon that should be with the scripted player. Nevermind, I thought I can sort it good later. So I made some changes to the script regarding derived stats from the player attributes. I did as the ones in the tutorial, but ith my own stamp on them. Odd things came from that, a static scripted player and no original player, I make more change to get it right.... I have had ll kind of things on my screen, from seeing the original player but with camera view fixed to the pawn....
anyway, below is a script, my one I am using. Could anyone be so kind as to tell me what is wrong with it? If I revert the lines asocietated with health and endurance to original. I have the situation I describe with moving origina player - fixed viewpoint pawn. chopping and changing confues me now. Please find it here:
{
WEAPONMODEL [TC_Longsword] // Weapon held by pawn
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 [Idle] // Idle AnimationSpeed
MAGIC_ANIM [Shoot2]
MELEE_ANIM_A [Slash2] // Shoot anim
MELEE_ANIM_B [Punch]
WALKANIM [Walk] // Walk anim
BACKANIM [WalkBack] // Walk back anim
STRAFELEFT [StrafeLeft] // Strafe left anim
STRAFERIGHT [StrafeRight] // Strafe right anim
INTERANIM [Punch] // Pawn interact anim
DEATHANIM [Die] // Death Anim
ROOTBONE [Bip01] // Pawn root bone
WEAPONHAND [Bip01 R Hand] // Pawn weapon bone
K_MELEE_A [73] // INTERACT KEY - RIGHT MOUSE
K_MELEE_B [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
TARGET [FALSE] //the current target
MELEE_DAMAGE [10] //base damage you do with melee weapon
MELEE_DIST [128] //maximum distance needed for melee attack
MELEE_RATE [2.0] //time between melee attacks
MELEE_DAMAGEATTRIB [health] //attribute that is damaged by melee attack
Spawn[()
{
Console(false);
BoxWidth(BOX);
SetGroup(GROUP);
AddAttribute(HEALTHATTRIB, 0, GetAttribute(“endurance”,”Player”)*5);
SetAttribute(HEALTHATTRIB, GetAttribute(“endurance”,”Player”)*5);
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(GetAttribute(HEALTHATTRIB) < 1)
{
HighLevel("Die");
return 0;
}
// handle controls
if(IsKeyDown(K_MELEE_A)
{
//fire/attack
if(ANC < 1)
{
//only go to shoot anim if at idle
ANIM=StringCopy(MELEE_ANIM));
ANC=1;
}
// Check fire rate
if(self.time > TM+MELEE_RATE)
{
TM=self.time;
TARGET= TraceToActor("BIP01FOOTSTEPS",0,1,MELEE_DIST);
If(TARGET=”FALSE”)
{
//do nothing
;
}
else
{
DamageEntity(MELEE_DAMAGE, MELEE_DAMAGEATTRIB*GetAttribute(“Strenght”,”Player”)/20, TARGET);
}
TM=self.time;
}
}
if(IsKeyDown(K_MELEE_B)
{
//fire/attack
if(ANC < 1)
{
//only go to shoot anim if at idle
ANIM=StringCopy(MELEE_ANIM));
ANC=1;
}
// Check fire rate
if(self.time > TM+MELEE_RATE)
{
TM=self.time;
TARGET= TraceToActor("BIP01FOOTSTEPS",0,1,MELEE_DIST);
If(TARGET=”FALSE”)
{
//do nothing
;
}
else
{
DamageEntity(MELEE_DAMAGE, MELEE_DAMAGEATTRIB*GetAttribute(“Strenght”,”Player”)/20, TARGET);
}
TM=self.time;
}
}
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(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*GetAttribute(“Speed”,”Player”)/20);
}]
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, "");
}]
}
Also I eventually want 3 melee anims and 1 magic casting anims assigned to 4 attack buttons on the keyboard, where can I find out which buttons correspond with which number codes?
Thank you again,
Damien Kieboor