Wank
Junior Member
Posts: 28
Threads: 11
Joined: May 2013
Reputation:
0
|
RE: Will this statue script work?
(05-25-2013, 06:38 PM)sonataarctica Wrote: (05-25-2013, 06:34 PM)Wank Wrote: (05-25-2013, 06:32 PM)sonataarctica Wrote: (05-25-2013, 06:12 PM)Wank Wrote: I want to make a statue appear, so I used the active entity script. I get no errors, but it doesn't work. I had already set it as inactive, but you can see it. The Enemy2 things are the statue. Is there another script for this?
void OnStart()
{
AddEntityCollideCallback("Player", "scr_spawnEnemy1", "SpawnEnemy1", true, 1);
AddEntityCollideCallback("Player", "spawnEnemy2", "EventCollide", true, 1);
AddUseItemCallback("", "key_study_one", "mansion_3", "UseKeyOnDoor", true);
}
void SpawnEnemy1(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Enemy1", true);
AddEnemyPatrolNode("Enemy1", "PathNodeArea_1", 0, "");
AddEnemyPatrolNode("Enemy1", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("Enemy1", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("Enemy1", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("Enemy1", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("Enemy1", "PathNodeArea_6", 0, "");
}
void UseKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_3", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_3", 0, false);
RemoveItem(asItem);
}
void EventCollide(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Enemy2", true);
}
(05-25-2013, 06:12 PM)Wank Wrote: I want to make a statue appear, so I used the active entity script. I get no errors, but it doesn't work. I had already set it as inactive.
void OnStart()
{
AddEntityCollideCallback("Player", "scr_spawnEnemy1", "SpawnEnemy1", true, 1);
AddEntityCollideCallback("Player", "spawnEnemy2", "EventCollide", true, 1);
AddUseItemCallback("", "key_study_one", "mansion_3", "UseKeyOnDoor", true);
}
void SpawnEnemy1(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Enemy1", true);
AddEnemyPatrolNode("Enemy1", "PathNodeArea_1", 0, "");
AddEnemyPatrolNode("Enemy1", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("Enemy1", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("Enemy1", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("Enemy1", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("Enemy1", "PathNodeArea_6", 0, "");
}
void UseKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_3", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_3", 0, false);
RemoveItem(asItem);
}
void EventCollide(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Enemy2", true);
}
All the enemy 2 stuff is the statue
This is not a scripting problem, it is the the entity itself. The entity is type static meaning that no matter what you do you won't be able to set it active/inactive. The only way you can do this is to create a new version of the statue using the ModelEditor. If you want to do this I can tell you how :-) Are you familiar with the ModelEditor?
No, i'm not. All I have really used is the LevelEditor.
It's pretty simple really Incase you want to try -
-Open the Model Editor
-Open the statue entity that you want to change
-Click Settings on the top menu
-Change the Type to Object (it's StaticProp currently)
-That's it! Save it as a new entity in your own custom story folder. This statue will be able to be activated and deactivated.
YES! Thank you, I appreciate it!
|
|