Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help Using MovePlayerForward Script
heyitsrobert97 Offline
Member

Posts: 68
Threads: 29
Joined: Jan 2012
Reputation: 0
#1
Using MovePlayerForward Script

Hey, I need to know How to Use This Script Code
MovePlayerForward(float afAmount)



“REQUIRES THE 1.2 PATCH: JUSTINE” Moves the player forward. It needs to be called in a timer that updates 60 times / second.

I entered it into one timer like this and it doesn't even move!

AddUseItemCallback("", "acidjar_1", "pathblock_1", "placeacid", true);
}

void placeacid(string &in asItem, string &in asEntity)
{
RemoveItem("acidjar_1");
SetEntityActive("explosivejar", true);
SetPlayerActive( false);
StartPlayerLookAt("walkto", 10.0f, 10.0f, "");
AddEntityCollideCallback("Player", "walkto", "lookexplosion", true, 1);
AddTimer("walktotimer", 0.3f, "atwalkto");
}

void atwalkto(string &in asTimer)
{
MovePlayerForward(15.0f);
}

void lookexplosion(string &in asParent, string &in asChild, int alState)
{
StopPlayerLookAt();
StartPlayerLookAt("explosivetable", 10.0f, 10.0f, "");
AddTimer("explodetimer", 1.0f, "explosion");
}

void explosion(string &in asTimer)
{
CreateParticleSystemAtEntity("", "ps_break_cavein.ps", "explosivejar", false);
StartEffectFlash(0.0f, 1.0f, 0.2f);
PlaySoundAtEntity("", "explosion_rock_large.snt", "barrel_1", 0, false);
SetEntityActive("explosivejar", false);
SetEntityActive("pathblock_1", false);
SetEntityActive("explosivetable", false);
SetPlayerActive( true);
}

Any Help It was supposed to be a thing where when you place explosives the player deactivates and walks to a script area, and then the jar explodes. but the Move Script isnt working.

This Darn House! , Four Doors, Youtube
04-06-2012, 03:23 PM
Find
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#2
RE: Using MovePlayerForward Script

It is not looping the timer. do something like:

void placeacid(string &in asItem, string &in asEntity)
{
RemoveItem("acidjar_1");
SetEntityActive("explosivejar", true);
SetPlayerActive( false);
StartPlayerLookAt("walkto", 10.0f, 10.0f, "");
AddEntityCollideCallback("Player", "walkto", "lookexplosion", true, 1);
AddTimer("walktotimer", 0.3f, "atwalkto");
}


void atwalkto(string &in asTimer)
{
MovePlayerForward(10.0f);
AddTimer("looper", 0.1f, "restart_walk");
}


void restart_walk(string &in asTimer)
{
AddTimer("restarter", 0, "atwalkto");
}



//________________

Then when you want him to stop, either on a timer or in a script area collide, place these:

RemoveTimer("looper");
RemoveTimer("restarter");
(This post was last modified: 04-06-2012, 04:43 PM by Statyk.)
04-06-2012, 04:43 PM
Find




Users browsing this thread: 1 Guest(s)