So Im making an amnesia custom story and at one point you walk down a staircase and a monster spawn in front of you. What you dont know is that its an hallucination. I want to spawn a wall behind you that prevents you from escaping when the monster spawns and then one more script that removes the wall when the hallucination disappears.
This is my current monster spawn script that Im using to spawn the hallucination. This script works what i want help with is spawning the wall! :
////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "Awesome_key", "Awesome_door", "ABC", true); AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1);
AddUseItemCallback("", "secret_key", "secret_door", "SECRET", true);
}
I would find the piece of wall you want, e.g. mansion_base_wall_default.dae, create an entity with it, and switch between enabled/disabled in-game as required.
You might be able to use SetPropActiveAndFade on static objects, but I'm not sure. If not, then yes, you need to create an entity for the wall you want to use. You do that by opening the model editor, go File > Import Mesh, find the model in the static_objects folder, add a box shape around the wall, create that shape into the collision body, go Edit > User Defined Variables and set the type to Object, subtype Static. Doing so will allow you to use the SetEntityActive script on the wall itself.
After that, just save that entity in the entities folder (preferrably inside your own custom subfolder), and use it from the level editor.
I've actually got a video on just this if you need a more detailed explanation.
The Technical support section is not there for development questions. Moved to correct forum. Also, have one thread for all your development questions and not 5 with the same title. Merged.
(This post was last modified: 03-21-2014, 08:36 PM by plutomaniac.)
(03-21-2014, 08:28 PM)Mudbill Wrote: You might be able to use SetPropActiveAndFade on static objects, but I'm not sure. If not, then yes, you need to create an entity for the wall you want to use. You do that by opening the model editor, go File > Import Mesh, find the model in the static_objects folder, add a box shape around the wall, create that shape into the collision body, go Edit > User Defined Variables and set the type to Object, subtype Static. Doing so will allow you to use the SetEntityActive script on the wall itself.
After that, just save that entity in the entities folder (preferrably inside your own custom subfolder), and use it from the level editor.
I've actually got a video on just this if you need a more detailed explanation.
I followed you instructions and created an entity. But when i get in to the editor and try to activate it it just dosent show up. Heres the script:
////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "Awesome_key", "Awesome_door", "ABC", true); AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1);
AddUseItemCallback("", "secret_key", "secret_door", "SECRET", true);
}
(03-21-2014, 11:32 PM)Mudbill Wrote: You mean you get to the game and it doesn't appear? Does the monster appear?
I start the map and everything works fine. The monster spawns but the wall dosen't. The monster and the wall is locked to one function as you can see and that function is locked to an area box. The area box works with the monster but not the wall.
is the wall static? I understand that you cant regularily activate/deactivate static objects
use model editor, and convert a copy of it to an entity
then replace the version in-game with the .ent for the modded wall
hope this helps