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
question about collides loops?
sabrinagsoledad Offline
Junior Member

Posts: 32
Threads: 10
Joined: Feb 2016
Reputation: 0
#1
question about collides loops?

Hi

Is it possible to make a collide function works every time the player enters to that script area?... e.g. the chekpoint where you enter it teleport to a position, but what I want to know how should I change the code to make it every time the player enteres the area he is teleport and not only the first time?
03-01-2016, 05:36 PM
Find
Spelos Away
Banned

Posts: 231
Threads: 19
Joined: Sep 2014
#2
RE: question about collides loops?

Quote:AddEntityCollideCallback("Player", "Area", "CollisionFunc", false, 1);

The false means the callback will NOT be deleted when Player touches the area.

PHP Code: (Select All)
void OnStart()
{
    
AddEntityCollideCallback("Player""Area""CollisionFunc"false1);
}

void CollisionFunc(string &in asParentstring &in asChildint alState
{
    
TeleportPlayer("PositionName");

03-01-2016, 05:40 PM
Find
sabrinagsoledad Offline
Junior Member

Posts: 32
Threads: 10
Joined: Feb 2016
Reputation: 0
#3
RE: question about collides loops?

Thanks!!!
03-02-2016, 01:23 AM
Find
sabrinagsoledad Offline
Junior Member

Posts: 32
Threads: 10
Joined: Feb 2016
Reputation: 0
#4
RE: question about collides loops?

One thing... I read a guide in the wiki about Checkpoints using ScriptArea's, and the code i made from that guide is the next...

OnStart()
{
AddEntityCollideCallback("Player", "AreaOfDeep", "Drowned", false, 1);
}

void Drowned(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "impact_water_high3.snt", "Player", 0, false);
CheckPoint("Checkpoint1", "PlayerStartArea_1","", "DeathCategory", "Deathtext");
}

Yet now nothing hapens... I read on that guide that for the chekpoint is not necesary kill the player if I dont want the the sound and screen effects when the player dies.

On the lang file I have this

<CATEGORY Name="DeathCategory">
<Entry Name="Deathtext"> Avoid water </Entry>
</CATEGORY>

But now in the game nothing hapens neither once get teleport...
03-02-2016, 06:11 PM
Find
Spelos Away
Banned

Posts: 231
Threads: 19
Joined: Sep 2014
#5
RE: question about collides loops?

I am going to make a video on this topic soon.

But the thing with CheckPoints is that you set it as soon as possible and by this command, you're actually saying:
IF player dies FROM THIS POINT, they will see THIS DEATH SCREEN, and APPEAR ON THIS POSITION, as well as (and this is optional) CALL THIS FUNCTION WHEN THEY APPEAR.

It has nothing to do with killing the player.
I already told you (I think) that if you want to kill the player, use
PHP Code: (Select All)
SetPlayerHealth(0.0f); 
AFTER the CheckPoint command.
03-02-2016, 06:28 PM
Find




Users browsing this thread: 1 Guest(s)