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
Straxedix Offline
Senior Member

Posts: 426
Threads: 52
Joined: Mar 2014
Reputation: 5
#11
RE: Portal

Sorry to say but this is working like 50%

First: portals (ps-s) are activated when you enter the map...
When i click on portal it gives me damage and that's okay...but i asked like in original amnesia to portal first be invisible,then when enter area first PS should activate slowly after some time second PS activate BUT when is first PS activated and if player clicks the portal he gets damage and stuff and when another PS activates when he clicks on portal it do the stuff...

My hps:
Spoiler below!
PHP Code: (Select All)
void OnStart()
{
AddEntityCollideCallback("Player""Visible""BeginPortal"true1);
SetEntityPlayerInteractCallback("Touch""TouchPortal"false);
}


void BeginPortal(string &in asParentstring &in asChildint alState)
{
CreateParticleSystemAtEntity("Poral_Open""ps_orb_room_portal_open.ps""Touch"false);
//Remember to create the different particle systems. I don't have the names here.

AddTimer("OpenPortal"5"PortalTimer");

SetEntityActive("Touch"true);
SetLocalVarInt("PortalOpen"0);
}

void PortalTimer(string &in asTimer)
{
if(
asTimer == "OpenPortal")
{
CreateParticleSystemAtEntity("Portal_Start""ps_orb_room_portal_start.ps""Visible"false);
//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"truefalse);
}
}

void UsePortal()
{
//Will add later.



Maybe it is my bad

(This post was last modified: 10-28-2014, 12:45 PM by Straxedix.)
10-28-2014, 12:44 PM
Find
FlawlessHappiness Offline
Posting Freak

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

I understand what you want.

You say the PSs goes active as they should. And you gain damage when you should... So what's not working?


Oh. Your problem was that it was already in the map. That's because you placed it in the map. You should NOT place the PS in the map. Only in the script.

Trying is the first step to success.
(This post was last modified: 10-28-2014, 12:52 PM by FlawlessHappiness.)
10-28-2014, 12:47 PM
Find
Straxedix Offline
Senior Member

Posts: 426
Threads: 52
Joined: Mar 2014
Reputation: 5
#13
RE: Portal

Not working think is that PS-s are activated when enter the maps..
-It should be when i enters area called "Visible"
Also not working think is that when i click on portal it gives me damage
-It should be when he enters area called "Visible" should slowly activate first ps then if player click on that ps (portal) he gets damage,then second ps-s activate slowly but first one disappear slowly.So when player now click on second ps he gets the
Spoiler below!
PHP Code: (Select All)
void UsePortal()
{
//Will add later.



10-28-2014, 12:51 PM
Find
FlawlessHappiness Offline
Posting Freak

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

Well, the second PS activates after 5 seconds, and then the player should not take damage anymore.

You may have accidentally placed the portal PS in your map. Delete it.

To destroy particle effects by script use DestroyParticleSystem("NAME");

Trying is the first step to success.
10-28-2014, 12:55 PM
Find
Straxedix Offline
Senior Member

Posts: 426
Threads: 52
Joined: Mar 2014
Reputation: 5
#15
RE: Portal

There are only 2 PS in mine map so...
And both PS-s are activated before entering "Visible" (but in level editor they are both Inactive)
Oh God damn i have to go to school :/

I will try to fix this when i come home... :/

(This post was last modified: 10-28-2014, 01:00 PM by Straxedix.)
10-28-2014, 12:59 PM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#16
RE: Portal

Use the CreateParticleSystemAtEntity script.

When you enter the area named "Visible" then you use that script to create your damaging particle system. You cannot really interact with particles though, but create an area there that you add the interaction callback to. You can either add the callback as you enter the area Visible, or have it already added but enable the disabled area instead when you enter Visible.

In the callback you added, give the player damage, run the DestroyParticleSystem script and another Create one to switch out the particles. Also either replace the area you interacted with with another, change which callback is applied to it, or use a variable in the existing callback (this one) to check if you've already interacted with it.

After that, another interaction can call your UsePortal(); script.

The only problem I can see is that the particles won't fade in and out unless they are made to do so (in the particle editor).

(This post was last modified: 10-28-2014, 01:01 PM by Mudbill.)
10-28-2014, 01:00 PM
Find
FlawlessHappiness Offline
Posting Freak

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

(10-28-2014, 01:00 PM)Mudbill Wrote: In the callback you added, give the player damage, run the DestroyParticleSystem script and another Create one to switch out the particles. Also either replace the area you interacted with with another, change which callback is applied to it, or use a variable in the existing callback (this one) to check if you've already interacted with it.

He's not supposed to take damage before the portal can spawn. It's only optional.


Also, Strax, just delete the PS in the Level Editor. You CANNOT set a particle system inactive. It doesn't work.

(10-28-2014, 01:00 PM)Mudbill Wrote: The only problem I can see is that the particles won't fade in and out unless they are made to do so (in the particle editor).

The portal particles fade in and out just fine. They were made like that by FG

Trying is the first step to success.
(This post was last modified: 10-28-2014, 01:03 PM by FlawlessHappiness.)
10-28-2014, 01:02 PM
Find
Straxedix Offline
Senior Member

Posts: 426
Threads: 52
Joined: Mar 2014
Reputation: 5
#18
RE: Portal

Also, Strax, just delete the PS in the Level Editor. You CANNOT set a particle system inactive. It doesn't work.


Wat ??? O.o Rlyyy ???

Btw i get srsly 2 problems:
First oneTongueortals visible ALWAYS so i need it when i enter "Visible"
Second one:It should be when he enters area called "Visible" should slowly activate first ps then if player click on that ps (portal) he gets damage,then second ps-s activate slowly but first one disappear slowly.So when player now click on second ps he gets the
Spoiler below!
PHP Code: (Select All)
void UsePortal()
{
//Will add later.



(This post was last modified: 10-29-2014, 01:39 PM by Straxedix.)
10-29-2014, 01:37 PM
Find
FlawlessHappiness Offline
Posting Freak

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

I'm having a hard time understanding you, it seems.

Could you send me your map, so that I can clarify that everything is correct?

Trying is the first step to success.
10-29-2014, 02:03 PM
Find
Straxedix Offline
Senior Member

Posts: 426
Threads: 52
Joined: Mar 2014
Reputation: 5
#20
RE: Portal

Okay when i get on computer i will see what i can do.

10-29-2014, 11:51 PM
Find




Users browsing this thread: 2 Guest(s)