The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Level changing area script not working?
Shoop Offline
Junior Member

Posts: 36
Threads: 10
Joined: Feb 2011
Reputation: 0
#1
Level changing area script not working?

I want someone to fall down a hole and the level change, whats wrong with this?
void OnStart()
{
AddUseItemCallback("", "key1", "castle_1", "UsedKeyOnDoor", true);
AddUseItemCallback("", "key2", "metal_1", "UsedKeyOnDoor2", true);
AddEntityCollideCallback("Player" , "ScriptArea_1" , "MonsterFunc1" , true , 1);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("castle_1", false, true);
PlaySoundAtEntity("", "unlock_door", "castle_1", 0, false);
RemoveItem("key1");
}

void UsedKeyOnDoor2(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("metal_1", false, true);
PlaySoundAtEntity("", "unlock_door", "metal_1", 0, false);
RemoveItem("key2");
}

void MonsterFunc1(string &in asParent , string &in asChild , int alState)
{
  SetEntityActive("servant_grunt_1" , true);
}

  ChangeMap("Level2", "PlayerStartArea_1", "break_stairs", "water_lurker_eat");

////////////////////////////
// Run when entering map
void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}
The last two ones are sound file names... I think thats how you do it. (I put my whole script just in case I did something else wrong that makes it not work)
(This post was last modified: 04-02-2011, 07:51 PM by Shoop.)
04-02-2011, 07:50 PM
Find


Messages In This Thread
Level changing area script not working? - by Shoop - 04-02-2011, 07:50 PM



Users browsing this thread: 1 Guest(s)