Frictional Games Forum (read-only)

Full Version: How do I transform an object into a monster?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am currently creating a map where the player needs to pick up an object. What I wish to do is make the player pass through a Script area, and then the object the player is currently holding becomes a monster right in front of him/her. I know some basic scripting, but not very advanced. How would I be able to do this, if I can?

(The item is NOT in the inventory, but rather, a held item.) Thanks in advance!
Make it so it is not the player that collides with the script area, but rather the item.
Place a squared script area in the middle of the corridor. (I guess it is a corridor)
Then put some diagonal block boxes so the item, is forced to hit the script area.

so the script:

void OnStart()
{

AddEntityCollideCallback("ITEM", "ScriptArea_1", "OnItemCollide_1", true, 1);
}

void OnItemCollide_1(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_1", true);
SetEntityActive("ITEM", false);

}
Beecakes solution looks great. That should work. You can always add additional effects like shake the screen or playing a sound to make it more intense or scarier.
Thanks for the help guys! It worked perfectly! I really appreciate this help. :}