Frictional Games Forum (read-only)
[CHAOS] Portal - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: [CHAOS] Portal (/thread-27003.html)

Pages: 1 2 3


RE: Portal - Straxedix - 10-28-2014

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:
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


RE: Portal - FlawlessHappiness - 10-28-2014

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.


RE: Portal - Straxedix - 10-28-2014

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:
void UsePortal()
{
//Will add later.





RE: Portal - FlawlessHappiness - 10-28-2014

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");


RE: Portal - Straxedix - 10-28-2014

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... :/


RE: Portal - Mudbill - 10-28-2014

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).


RE: Portal - FlawlessHappiness - 10-28-2014

(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


RE: Portal - Straxedix - 10-29-2014

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:
void UsePortal()
{
//Will add later.





RE: Portal - FlawlessHappiness - 10-29-2014

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?


RE: Portal - Straxedix - 10-29-2014

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