Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support | Shelf | Store

Privacy Policy


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Elevator Rooms
Author Message
Nuclearbones Offline
Junior Member

Posts: 45
Joined: May 2012
Reputation: 0
Post: #3
RE: Elevator Rooms
(06-09-2012 04:13 AM)Your Computer Wrote:  If you don't get any errors with that, then you're either working on the wrong script or you named your HPS file incorrectly.

As for what you want to achieve: You have to define the ChangeMap collision callback before it'll be called. However, using script areas to detect whether or not a lever has been pulled means you have come to misunderstand how to script for levers. The proper function is SetEntityConnectionStateChangeCallback. Once you have finally defined the callback, you can then move the original ChangeMap function which you have in OnStart to where it belongs: in the state change callThanks
Thanks. Now I just have to get rid of the "Expected data type" error in the changemap function.
////////////////////////////
// Run first time starting map
void OnStart()
{  
    AddUseItemCallback("", "Gatekey_1", "elevator_door_2", "KeyOnDoor", true);
    
    SetEntityConnectionStateChangeCallback("Elevator", "Changemap");

}

void KeyOnDoor(string &in asItem, string &in asEntity)
{
    SetSwingDoorLocked("elevator_door_1", false, true);
    PlaySoundAtEntity("", "unlock_door.snt", "elevator_door_1", 0.0f, false);
    RemoveItem("Gatekey_1");
    AddDebugMessage("KeyOnDoor", false);
}

void ChangeMap("lvl03_aMAZEing.map", "PlayerStartArea_1", "14_elevator_activate.snt", "elevator_stop.snt")
{

}



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

}

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

}

Think you might be able to help with that too?
06-09-2012 06:53 AM
Find all posts by this user Quote this message in a reply
Post Reply 


Messages In This Thread
Elevator Rooms - Nuclearbones - 06-09-2012, 03:45 AM
RE: Elevator Rooms - Your Computer - 06-09-2012, 04:13 AM
RE: Elevator Rooms - Nuclearbones - 06-09-2012 06:53 AM



User(s) browsing this thread: 1 Guest(s)