The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



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
Making a Trap
Southlaguna Offline
Member

Posts: 70
Threads: 21
Joined: Jan 2012
Reputation: 0
#1
Making a Trap

Hey y'all. Once again another question on scripting shtuff. So 'm trying to make a trap that you can avoid once activated. But i cant figure out how to work the alState specifics. I want to make that if you leave the area before the trap makes contact with you, you survive. Heres how far ive gotten with this..


OnStart{
AddEntityCollideCallback("Player", "spike_trap", "SpikeTrapAltar", true, 1);
}

void SpikeTrapAltar(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("swomp", "L01_pierce01", "spike_trap", 0.0, false);
PlaySoundAtEntity("swomp2", "L01_pierce02", "spike_trap", 0.0, false);

for (int x = 0; x <= 11; x += 1){
RotatePropToSpeed("roof_wheel_"+x, 1, 3, 0, 0, -1, false, "");
}
for (int i = 0; i <= 6; i += 1){
SetMoveObjectStateExt("roof_pole_"+i, -0.4f, 2.0f, 5.0f, 1.0f, true);
}
if (alState == 0){
AddTimer("pierce1", 0.3f, "TimerStopPierce");
}
if (alState == 1){
AddTimer("dead", 0.7f, "YourDeadBoy");
}

}
void YourDeadBoy ( string &in asTimer )
{
PlaySoundAtEntity("", "stab_impact.snt", "Player", 1.0f, false);
PlaySoundAtEntity("", "spiketrap_death", "Player", 1.0f, false);
SetPlayerHealth(0);
}
void TimerStopPierce ( string &in asTimer )
{
RemoveTimer("dead");
}
trap works, Just cant get the guy to survive when hes out of position... Help? Pweease

12-26-2015, 10:45 PM
Find


Messages In This Thread
Making a Trap - by Southlaguna - 12-26-2015, 10:45 PM
RE: Making a Trap - by Spelos - 12-26-2015, 11:01 PM
RE: Making a Trap - by Mudbill - 12-26-2015, 11:39 PM
RE: Making a Trap - by Spelos - 12-26-2015, 11:46 PM
RE: Making a Trap - by Mudbill - 12-26-2015, 11:53 PM
RE: Making a Trap - by Spelos - 12-26-2015, 11:59 PM
RE: Making a Trap - by Southlaguna - 01-03-2016, 08:26 AM
RE: Making a Trap - by Traggey - 01-03-2016, 10:32 PM



Users browsing this thread: 1 Guest(s)