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
Need help!!! Script...
jessehmusic Offline
Senior Member

Posts: 423
Threads: 102
Joined: Dec 2011
Reputation: 8
#1
Need help!!! Script...

Hello i cant get this to work ! :'( A Locked Key to be open by a key on the floor but cant get it to work please help and cant get the key to get name "Cell Key" Here is the scripts...

PHP Code: (Select All)
////////////////////////////
// Run first time starting map
 
void OnEnter()
{
void AddUseItemCallback("""cellkey_1""celldoor_1"UsedKeyOnDoor", True);
}

void MyFunc(string &in asItem, string &in asEntity)
{
  SetSwingDoorLocked("
celldoor_1", "false", true);
  PlaySoundAtEntity("", "
unlock_door", "celldoor_1", 0, false);
  RemoveItem(cellkey_1);
}
    
////////////////////////////
// Run when Leaving map
void onleave 
{




And here is Lang script

PHP Code: (Select All)
<Main
    Name
="The Espace From Caslte"
    
Author="Hasse951 Aka Jesseh Music"
        
StartMap="00.intro.map"
    
StartPos=""
/>
<
LANGUAGE>
   <
CATEGORY Name="The Esapace From Castle">
      <
Entry Name="Jonah is escaping from the castle in a middle of no were ">
     
   </
CATEGORY>
</
LANGUAGE>

<
CATEGORY Name ="Inventory">
        <
Entry Name="Itemdeac_cellkey_1">"Cell key to the locked Cell door"</Entry>
        <
Entry Name="ItemName_cellkey_1">Cell Key</Entry
        
    
</CATEGORY>
</
LANGUAGE
im new on scripts first day im working with it! please answer!

http://www.moddb.com/mods/jessehmusic - Hospital of horror , WIP
(This post was last modified: 12-22-2011, 02:01 PM by jessehmusic.)
12-22-2011, 02:01 PM
Website Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#2
RE: Need help!!! Script...

Use this:
Quote:void OnEnter()
{
void AddUseItemCallback("", "cellkey_1", "celldoor_1", "UsedKeyOnDoor", true);
}

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

////////////////////////////
// Run when Leaving map
void onleave
{
}
The mistakes were that you used a captiel T in true, you didn't put the other quotation mark on UsedKeyOnDoor in void onEnter. Some other mistakes you made in the rest of the script were missing quotations from RemoveItem("cellkey_1");, you also didn't name your function right.. If that doesn't work post it again.

(This post was last modified: 12-22-2011, 02:36 PM by flamez3.)
12-22-2011, 02:36 PM
Find
jessehmusic Offline
Senior Member

Posts: 423
Threads: 102
Joined: Dec 2011
Reputation: 8
#3
RE: Need help!!! Script...

okey ty testing
It dosnt work :S it comes error and game closing.. :S
And i think this lang is wrong :S
PHP Code: (Select All)
<Main
    Name
="The Espace From Caslte"
    
Author="Hasse951 Aka Jesseh Music"
        
StartMap="00.intro.map"
    
StartPos=""

    
<LANGUAGE>
   <
CATEGORY Name="The Esapace From Castle">
      <
Entry Name="Jonah is escaping from the castle in a middle of no were ">
     
   </
CATEGORY>
</
LANGUAGE>

<
CATEGORY Name ="Inventory">
        <
Entry Name="Itemdeac_cellkey_1">"Cell key to the locked Cell door"</Entry>
        <
Entry Name="ItemName_cellkey_1">Cell Key</Entry
        
    
</CATEGORY>
</
LANGUAGE

http://www.moddb.com/mods/jessehmusic - Hospital of horror , WIP
(This post was last modified: 12-22-2011, 02:59 PM by jessehmusic.)
12-22-2011, 02:53 PM
Website Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#4
RE: Need help!!! Script...

Ok. Make a new text document file and rename it to: custom_story_settings, now make it a .cfg file. After that put this into that file (through opening it with notepad):


Quote:<Main

Name = ""
Author = ""
ImgFile = ""

MapsFolder = ""
StartMap = ""
StartPos = ""
/>

Fill out what you want and save it to your custom story directory.

Now make another text document and name it: extra_english and make it a .lang file. After that go into it by using notepad and put this in:
Quote:<LANGUAGE>


<CATEGORY Name="CustomStoryMain">
<Entry Name="Description">You need to turn off the generator. Do it fast. What a great story</Entry>
</CATEGORY>

<CATEGORY Name ="Inventory">
<Entry Name="Itemdeac_cellkey_1">"Cell key to the locked Cell door"</Entry>
<Entry Name="ItemName_cellkey_1">Cell Key</Entry

</CATEGORY>
</LANGUAGE>

Save to your custom story directory as well. It should work now.

(This post was last modified: 12-22-2011, 03:07 PM by flamez3.)
12-22-2011, 03:07 PM
Find
jessehmusic Offline
Senior Member

Posts: 423
Threads: 102
Joined: Dec 2011
Reputation: 8
#5
RE: Need help!!! Script...

ffs!! why does it not work hps file is wrong ...
void OnEnter()
{
void AddUseItemCallback("", "cellkey_1", "celldoor_1", "UsedKeyOnDoor", true);
}

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

////////////////////////////
// Run when Leaving map
void onleave
{
}
<Main

Name = "The Castle"
Author = "Hasse951    "
ImgFile = ""

MapsFolder = "K:\Amnesia - The Dark Descent\redist\custom_stories\Lets go to darkness\maps"
StartMap = "00.intro.map"
StartPos = ""
/>

<LANGUAGE>


<CATEGORY Name="CustomStoryMain">
<Entry Name="Description">You need to turn off the generator. Do it fast. What a great story</Entry>
</CATEGORY>

<CATEGORY Name ="Inventory">
<Entry Name="Itemdeac_cellkey_1">"Cell key to the locked Cell door"</Entry>
<Entry Name="ItemName_cellkey_1">Cell Key</Entry

</CATEGORY>
</LANGUAGE>

http://www.moddb.com/mods/jessehmusic - Hospital of horror , WIP
(This post was last modified: 12-22-2011, 03:20 PM by jessehmusic.)
12-22-2011, 03:19 PM
Website Find
Unearthlybrutal Offline
Posting Freak

Posts: 775
Threads: 12
Joined: May 2011
Reputation: 26
#6
RE: Need help!!! Script...


Try this to your .lang file
Spoiler below!


<LANGUAGE>


<CATEGORY Name="CustomStoryMain">
<Entry Name="Description">You need to turn off the generator. Do it fast. What a great story</Entry>
</CATEGORY>

<CATEGORY Name ="Inventory">
<Entry Name="ItemDesc_cellkey_1">"Cell key to the locked Cell door"</Entry>
<Entry Name="ItemName_cellkey_1">Cell Key</Entry

</CATEGORY>
</LANGUAGE>




And this to your .cfg file

Spoiler below!


<Main
Name = "The Castle"
Author = "Hasse951 "
ImgFile = ""
MapsFolder = "maps/"
StartMap = "00.intro.map"
StartPos = ""
/>




When Life No Longer Exists
Full-conversion mod
12-22-2011, 03:30 PM
Website Find
jessehmusic Offline
Senior Member

Posts: 423
Threads: 102
Joined: Dec 2011
Reputation: 8
#7
RE: Need help!!! Script...

do you know the script to unlock a door...
Is this right
PHP Code: (Select All)
////////////////////////////
// Run when entering map
void OnEnter()
{
 
AddUseItemCallback("""key_1""celldoor_1""UsedKeyOnDoor"true);
 
}
{
   
UsedKeyOnDoor(string &in asItemstring &in asEntity)
}
   
SetSwingDoorLocked("celldoor_1"falsetrue);
 
PlaySoundAtEntity("""unlock_door""celldoor_1"0false);
 
RemoveItem("key_1");
 
////////////////////////////
// Run when leaving map
void OnLeave()
{
 


Have Made new key


http://www.moddb.com/mods/jessehmusic - Hospital of horror , WIP
(This post was last modified: 12-22-2011, 05:04 PM by jessehmusic.)
12-22-2011, 04:54 PM
Website Find
Unearthlybrutal Offline
Posting Freak

Posts: 775
Threads: 12
Joined: May 2011
Reputation: 26
#8
RE: Need help!!! Script...

Click the key on level editor, open second tab on the right.
There is "CallbackFunc", type there "usekey" and then use this to your .hps file:

Spoiler below!


void OnEnter()
{
void AddUseItemCallback("usekey", "cellkey_1", "celldoor_1", "UsedKeyOnDoor", true);
}

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

////////////////////////////
// Run when Leaving map
void onleave
{
}




When Life No Longer Exists
Full-conversion mod
12-22-2011, 05:04 PM
Website Find
jessehmusic Offline
Senior Member

Posts: 423
Threads: 102
Joined: Dec 2011
Reputation: 8
#9
RE: Need help!!! Script...

Now cant i even find the map in the Custom storyies in game :'( this is what i have in CFG

[code<Main
Name = "The Castle"
Author = "Hasse951 "
ImgFile = "story.png"
MapsFolder = "maps/"
StartMap = "00.intro.map"
StartPos = ""
/>][/code]

this LAng
PHP Code: (Select All)
<LANGUAGE>


 <
CATEGORY Name="CustomStoryMain">
 <
Entry Name="Description">This is the story about Jonah was prisoner in the castle in middle of now were.</Entry>
 </
CATEGORY>

 <
CATEGORY Name ="Inventory">
 <
Entry Name="ItemDesc_key_1">"Cell Key"</Entry>
 <
Entry Name="ItemName_ckey_1">Cell Key</Entry

 
</CATEGORY>
 </
LANGUAGE

And this ph File in Intro

[php////////////////////////////
// Run when entering map
void OnEnter()
{
AddUseItemCallback("", "key_1", "celldoor_1", "UsedKeyOnDoor", true);

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

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

}

[/php]

http://www.moddb.com/mods/jessehmusic - Hospital of horror , WIP
12-22-2011, 05:11 PM
Website Find
jessehmusic Offline
Senior Member

Posts: 423
Threads: 102
Joined: Dec 2011
Reputation: 8
#10
RE: Need help!!! Script...

Btw What i gonna set on Callback func on The door...

http://www.moddb.com/mods/jessehmusic - Hospital of horror , WIP
12-22-2011, 06:54 PM
Website Find




Users browsing this thread: 3 Guest(s)