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
Looking at, or not looking at script
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#1
Looking at, or not looking at script

I've read some threads about this, but i didn't really get the answer i need.

In my custom story, there is an iron maiden, working like in the main story. The iron maiden opens, and you get blur effects and so on, but there is also a body inside that iron maiden, and i want that body to disappear just when you look away...

The script i made myself looks like this:

Spoiler below!


void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "OnPlayerCollide1", true, 1);

}


void OnPlayerCollide1(string &in asParent, string &in asChild, int alState)
{

AddBodyImpulse("iron_maiden_1_leftDoor", 0, 0, -10, "world");
AddBodyImpulse("iron_maiden_1_rightDoor", 0, 0, 10, "world");
SetEntityActive("corpse_male_1", true);
FadeRadialBlurTo(1, 0.3);
GiveSanityDamage(5.0, true);
StartPlayerLookAt("corpse_male_1", 10, 10, "");
AddTimer("", 2, "StopPlayerLookAt_2");

SetEntityPlayerLookAtCallback("corpse_male_1", "CorpseDisappear_1", false);

}

void CorpseDisappear_1(string &in asEntity, int alState)
{

if (alState == -1)
{
SetEntityActive("corpse_male_1", false);
}

}

void StopPlayerLookAt_2(string &in asTimer)
{
StopPlayerLookAt();
FadeRadialBlurTo(0, 0.1);
}


Everything works perfect, except, the body disappears no matter where im looking... It just spawns, and despawns..

I heard something about Localvar checking stuff.. haven't used it before.. is that it?

Trying is the first step to success.
05-06-2012, 01:14 PM
Find


Messages In This Thread
Looking at, or not looking at script - by FlawlessHappiness - 05-06-2012, 01:14 PM



Users browsing this thread: 1 Guest(s)