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
Amnesia Editor: Scripting
Aweno Offline
Junior Member

Posts: 4
Threads: 2
Joined: Nov 2011
Reputation: 0
#1
Question  Amnesia Editor: Scripting

'Right.

-Hey, y'all two-two, 'I'm new on these forums, 'and-- I'm not set to where in the forums to post this thread about my problem I've tiredly trying to solve, 'and-- I'ven't find a solution to this point.

'So, I'm working on a custom-story for Amnesia: The Dark Descent, 'it's called 'Decay' - and for the rooting beginning, I've built a cellar, 'typically close to the 'Wine Cellar' in the original story, 'which's identical to a blocked-out mine, 'but, yeah - you wake up in a wooden-framed bed, and stagger off to find a lantern inside of the dirt-blocked 'corridor', then you find a letter, 'where you see that someone's written an evident 'last note' or 'last words', where they've corded their death to a cave-in from inside a mine-shaft, 'which belongs to the story, 'but-- here's the deal, you find a key, 'but in order to get to the door that the key's supposed to basically unlock, 'you've to get through the mine's 'cellar'-door, 'and you don't've a key.

-Look at this, 'I want the player to, 'as he picks up a tinderbox or examines a box close to the door's frame he's/she's scripted to go down onto the player's knees, or lie down, 'to check the empty space below the door and the door-frame, 'and there's where the one playing's to find a crowbar, 'but I've no idea how to do this, 'I know that I'm driving to use two commands with 'headpos-- or 'rollheadto'-something, 'I know how to use .hps fairly well, 'but I'm not sure how to make the player - 'when he/she picks up the tinderbox - to get on their knees and look below the door's empty space, I've tried it, 'and I'ven't found any good way to use an 'examine'-area, 'or any way at all to do this. 'My best try'd strike for the 'OnPickup' for the tinderbox, 'but I don't know how to execute the script...! 'I'd like some help with this, 'and I'm sorry for the long text, 'but, here it's.

-Here is my entire .hps-file...

////////////////////////////////
// Run first time starting map
void OnStart()
{
SetLocalVarInt("iIntroPart", 0); // Initialize the sequence to null
}


void OnEnter()
{
AddTimer("tmrIntro", 1.0f, "introSequence"); // Launch the introduction sequence 1 second in
}


void introSequence(string &in asTimer)
{
AddLocalVarInt("iIntroPart", 1); // Increment the part so we move onto the next (first run through will make this 1, or the first part)
float partSpeed = 1.5f; // This denotes the DEFAULT value for how long parts last in seconds
switch (GetLocalVarInt("iIntroPart"))
{
case 1: // First part
// Actions such as FadeIn, PlaySoundAtEntity, whatever you like. This will be a simple wake up sequence
partSpeed = 5.0f; // I want this part to last 5 seconds
FadeOut(0.0f); // Instantly turn screen to black
FadePlayerRollTo(50, 220, 220); // Simulate being on the bed
MovePlayerHeadPos(1.7, 0.03, 0.0, 0.5, 0.2); // Simulate LYING onto the bed
FadeIn(20.0f); // Fade the screen in from black, 20 secs long
break;
case 2: // Second part
partSpeed = 5.0f; // I want this part to last 5 seconds
FadePlayerRollTo(0.0f, 33.0f, 33.0f); // Make the player's view normal
MovePlayerHeadPos(0, 0, 0, 1, 0.5f); // Make the player's view normal


// Player is woken up!
break;
}

if (GetLocalVarInt("iIntroPart") <2) // If the current part is less than the total length of the sequence (in this case 2)
{
// Then we want to call the same function again to continue the sequence!
AddTimer("tmrIntro", partSpeed, "introSequence"); // Notice that we use "partSpeed" as the delay, which will make the current part last for how ever long we specified Smile
}
}


//USE OF KEY
void OnLeave()
{
AddUseItemCallback("", "awesomekey_1", "mansion_1", "KeyOnDoor", true);
}


void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_1", 0, false);
RemoveItem("awesomekey_1");
}


////////////////////////////////
// On stepping inside of the scripted area
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
StopSound("wall_crawl", 0);
//COLLIDING
AddEntityCollideCallback("Player", "ScriptArea_1", "wall_crawl", false, 1);
PlaySoundAtEntity("wall_crawl", "15_wall_crawl", "wall_crawl", 0, false);
}


// ON EXAMINING THE DOOR'S SPACE BELOW THE DOOR
void OnLoadMap()
{
SetEntityCallbackFunc("tinderbox_lookbelow", "OnPickup");
}


void OnPickup(string &in asEntity, string &in type)
{
FadePlayerRollTo(50, 220, 220);
MovePlayerHeadPos(1.7, 0.03, 0.0, 0.5, 0.2);
PlaySoundAtEntity("drag_dirt", "03_drag_dirt", "Player", 0, false);
}



'And here's my apparently useless piece of script:

// ON EXAMINING THE DOOR'S SPACE BELOW THE DOOR
void OnLoadMap()
{
SetEntityCallbackFunc("tinderbox_lookbelow", "OnPickup");
}


void OnPickup(string &in asEntity, string &in type)
{
FadePlayerRollTo(50, 220, 220);
MovePlayerHeadPos(1.7, 0.03, 0.0, 0.5, 0.2);
PlaySoundAtEntity("drag_dirt", "03_drag_dirt", "Player", 0, false);
}


'If you can assist me, 'please share that with me, I'd really like to continue this map, 'it looks good, so far.

-Thank YOU for your time. ;'3



11-25-2011, 10:59 PM
Find


Messages In This Thread
Amnesia Editor: Scripting - by Aweno - 11-25-2011, 10:59 PM
RE: Amnesia Editor: Scripting - by Statyk - 11-25-2011, 11:30 PM
RE: Amnesia Editor: Scripting - by Aweno - 11-26-2011, 03:09 PM
RE: Amnesia Editor: Scripting - by Statyk - 11-27-2011, 02:01 AM



Users browsing this thread: 1 Guest(s)