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


Thread Rating:
  • 2 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Multiple Issues Help Portal
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#4
RE: Portal

Ok, let's do this.

We're gonna need 2 areas.

Area1 = The area the player collides with.
Area2 = The area the player touches.

void OnStart()
{
AddEntityCollideCallback("Player", "Area1", "BeginPortal", true, 1);

SetEntityPlayerInteractCallback("Area2", "TouchPortal", false);
}

void BeginPortal(string &in asParent, string &in asChild, int alState)
{
CreateParticleSystemAtEntity(string& asPSName, string& asPSFile, string& asEntity, bool abSavePS);
//Remember to create the different particle systems. I don't have the names here.

AddTimer("OpenPortal", 5, "PortalTimer");

SetEntityActive("Area2", true);
SetLocalVarInt("PortalOpen", 0);
}

void PortalTimer(string &in asTimer)
{
if(asTimer == "OpenPortal")
{
CreateParticleSystemAtEntity(string& asPSName, string& asPSFile, string& asEntity, bool abSavePS);
//Remember to create the different particle systems. I don't have the names here.

SetLocalVarInt("PortalOpen", 1);
}
}

void TouchPortal(string &in asEntity)
{
if(GetLocalVarInt("PortalOpen") == 1)
{
UsePortal();
}
else
{
GivePlayerDamage(1.0f, "BloodSplat", true, false);
}
}

void UsePortal()
{
//Do stuff when using portal.
}

Trying is the first step to success.
10-28-2014, 11:48 AM
Find


Messages In This Thread
Portal - by Straxedix - 10-28-2014, 10:03 AM
RE: Portal - by Mudbill - 10-28-2014, 10:28 AM
RE: Portal - by Straxedix - 10-28-2014, 10:35 AM
RE: Portal - by FlawlessHappiness - 10-28-2014, 11:48 AM
RE: Portal - by Straxedix - 10-28-2014, 11:54 AM
RE: Portal - by FlawlessHappiness - 10-28-2014, 12:03 PM
RE: Portal - by Straxedix - 10-28-2014, 12:28 PM
RE: Portal - by FlawlessHappiness - 10-28-2014, 12:32 PM
RE: Portal - by Straxedix - 10-28-2014, 12:34 PM
RE: Portal - by FlawlessHappiness - 10-28-2014, 12:35 PM
RE: Portal - by Straxedix - 10-28-2014, 12:44 PM
RE: Portal - by FlawlessHappiness - 10-28-2014, 12:47 PM
RE: Portal - by Straxedix - 10-28-2014, 12:51 PM
RE: Portal - by FlawlessHappiness - 10-28-2014, 12:55 PM
RE: Portal - by Straxedix - 10-28-2014, 12:59 PM
RE: Portal - by Mudbill - 10-28-2014, 01:00 PM
RE: Portal - by FlawlessHappiness - 10-28-2014, 01:02 PM
RE: Portal - by Straxedix - 10-29-2014, 01:37 PM
RE: Portal - by Straxedix - 10-30-2014, 01:37 PM
RE: Portal - by FlawlessHappiness - 10-29-2014, 02:03 PM
RE: Portal - by Straxedix - 10-29-2014, 11:51 PM



Users browsing this thread: 1 Guest(s)