Frictional Games Forum (read-only)

Full Version: Make Statues Appear Behind You?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hello everyone! I have another question about scripting that I'm stuck on again.
My question is, is in my story, there is a secret room which you have to find a key for. After you find the key and unlock the door, there is an Iron Maiden. When the player opens the Iron Maiden, it's full of good things such as oil potions, health potions and sanity potions. After the player picks up the goodies, there is a note that simply reads "See, not all Iron Maiden's are bad". And after you read it and turn around, there is a random statue just standing there behind the player.

Does anyone know how to script this and how I would set it up so a statue would appear behind you after reading the note? I've seen multiple things this, but not knowing how to set up the whole thing. Like in a custom story, a note will say "Behind you", and when you turn around, there is a statue there or a monster or whatever. Can anyone help me with this?

Thank you in advanced!

EDIT: Ah, wait, never mind, kind of. I just did the same scripting I did with the grunt that appears behind you by using the SetEntityActive thingy. I put that in the Iron Maiden so I made it appear before you leave the secret room. But if anybody knows how to make it so when I pick up something too, then it appears behind you if it's possible, please feel free to reply!
Under the properties of the note, there is a space with something called "SetInteractCallback" (Or something like that).

In there, write your function. It could be "StatueAppearFunction".

Then in you script write:

void StatueAppearFunction(string &in asEntity)
{
SetEntityActive("ENTITY", true);
}
I am trying to do the same thing, but I want the statue to appear when the player collides with a certain script area. I have tried the SetEntityActive and CreateEntityAtArea functions but to no avail. I'm working with an eagle statue, but don't know which function to use. If you could please explain in detail how to make the statue appear, I would really appreciate it!
(02-28-2013, 01:42 AM)thetastyfish Wrote: [ -> ]I am trying to do the same thing, but I want the statue to appear when the player collides with a certain script area. I have tried the SetEntityActive and CreateEntityAtArea functions but to no avail. I'm working with an eagle statue, but don't know which function to use. If you could please explain in detail how to make the statue appear, I would really appreciate it!

Use 'PlayerCollideCallback' and 'SetEntityActive'? If it's not working you're probably not doing it right.
(02-28-2013, 02:03 AM)Tigerwaw Wrote: [ -> ]
(02-28-2013, 01:42 AM)thetastyfish Wrote: [ -> ]I am trying to do the same thing, but I want the statue to appear when the player collides with a certain script area. I have tried the SetEntityActive and CreateEntityAtArea functions but to no avail. I'm working with an eagle statue, but don't know which function to use. If you could please explain in detail how to make the statue appear, I would really appreciate it!

Use 'PlayerCollideCallback' and 'SetEntityActive'? If it's not working you're probably not doing it right.

void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_7", "FUNCTION7", true, 1);
}

void FUNCTION7(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("eagle_1", true);
SetLightVisible("PointLight_2", true);
SetLightVisible("PointLight_1", true);
}


This is what I've tried, and it doesn't work.
(02-28-2013, 03:47 AM)thetastyfish Wrote: [ -> ]
(02-28-2013, 02:03 AM)Tigerwaw Wrote: [ -> ]
(02-28-2013, 01:42 AM)thetastyfish Wrote: [ -> ]I am trying to do the same thing, but I want the statue to appear when the player collides with a certain script area. I have tried the SetEntityActive and CreateEntityAtArea functions but to no avail. I'm working with an eagle statue, but don't know which function to use. If you could please explain in detail how to make the statue appear, I would really appreciate it!

Use 'PlayerCollideCallback' and 'SetEntityActive'? If it's not working you're probably not doing it right.

void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_7", "FUNCTION7", true, 1);
}

void FUNCTION7(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("eagle_1", true);
SetLightVisible("PointLight_2", true);
SetLightVisible("PointLight_1", true);
}


This is what I've tried, and it doesn't work.

Did you collide with ScriptArea_7 in-game?
(02-28-2013, 08:17 AM)JustAnotherPlayer Wrote: [ -> ]
(02-28-2013, 03:47 AM)thetastyfish Wrote: [ -> ]
(02-28-2013, 02:03 AM)Tigerwaw Wrote: [ -> ]
(02-28-2013, 01:42 AM)thetastyfish Wrote: [ -> ]I am trying to do the same thing, but I want the statue to appear when the player collides with a certain script area. I have tried the SetEntityActive and CreateEntityAtArea functions but to no avail. I'm working with an eagle statue, but don't know which function to use. If you could please explain in detail how to make the statue appear, I would really appreciate it!

Use 'PlayerCollideCallback' and 'SetEntityActive'? If it's not working you're probably not doing it right.

void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_7", "FUNCTION7", true, 1);
}

void FUNCTION7(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("eagle_1", true);
SetLightVisible("PointLight_2", true);
SetLightVisible("PointLight_1", true);
}


This is what I've tried, and it doesn't work.

Did you collide with ScriptArea_7 in-game?

I did, and it didn't work.
Make sure you've named everything right in the level editor.
The eagle is a static_object!
Static objects cannot(!) be set active and inactive.

To solve this you need to create a .ent file for the eagle (By copying it from another entity, and editing the .dea path).
After that make it an object that cannot be moved, but do not make it into a static object because this will result in the same as static_objects.
(02-28-2013, 02:14 PM)BeeKayK Wrote: [ -> ]The eagle is a static_object!
Static objects cannot(!) be set active and inactive.

The eagle is an entity, under statues.
Pages: 1 2