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
HELP ME! My scripting seems right but doesn't work. Please Help.
Wapez Offline
Senior Member

Posts: 360
Threads: 37
Joined: Mar 2012
Reputation: 19
#1
HELP ME! My scripting seems right but doesn't work. Please Help.

Hi I would like to know what's wrong with this. The door isn't locked and the key shows up without name and description. Please help.


//===========================================
// Starter's Script File!
//===========================================

//===========================================
// This runs when the map first starts
void OnStart()
{

AddUseItemCallback("", "firstdoorkey1", "firstdoor", "UsedKeyOnDoor", true);

}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)

{

SetSwingDoorLocked("firstdoor", false, true);
PlaySoundAtEntity("", "unlock_door", "firstdoor", 0, false);
RemoveItem("firstdoorkey1");

}
//===========================================
// This runs when the player enters the map
void OnEnter()
{
}
//===========================================
// This runs when the player leaves the map
void OnLeave()
{
}

This is my .lang file:

<LANGUAGE>
<CATEGORY Name="TutorialStory">
<Entry Name="Description">This is a tutorial story. [br] [br]I hope you like it! Big Grin </Entry>
</CATEGORY>
<CATEGORY Name="Inventory">
<Entry Name="ItemDesc_firstdoorkey>"Key to First Door"</Entry>
<Entry Name="ItemName_firstdoorkey>First Door Key</Entry>
</CATEGORY>
<CATEGORY Name="Journal">
<Entry Name="Note_Introduction_Name">Welcome.</Entry>
<Entry Name="Note_Introduction_Text">You shall die...</Entry>
</CATEGORY>
</LANGUAGE>

Founder & Legally Accountable Publisher of Red Line Games.
Environment & Gameplay Designer and Scripter.
http://moddb.com/mods/in-lucys-eyes
(This post was last modified: 03-28-2012, 04:07 PM by Wapez.)
03-28-2012, 03:12 PM
Find
Greven Offline
Member

Posts: 106
Threads: 13
Joined: May 2011
Reputation: 3
#2
RE: HELP ME! My scripting seems right but doesn't work. Please Help.

Have you named the entities in the entity tabs so the script can know what its supposed to lock/show?

For example the key is named in the second entity tab under the CustomSubItemTypeName. And the door in the first entity tab.

[WIP] Recidivus
03-28-2012, 04:53 PM
Find
Wapez Offline
Senior Member

Posts: 360
Threads: 37
Joined: Mar 2012
Reputation: 19
#3
RE: HELP ME! My scripting seems right but doesn't work. Please Help.

(03-28-2012, 04:53 PM)Greven Wrote: Have you named the entities in the entity tabs so the script can know what its supposed to lock/show?

For example the key is named in the second entity tab under the CustomSubItemTypeName. And the door in the first entity tab.
Yes, the key is named Key1 in the "CustomSubItemTypeName" in the entity tab.
My notes won't work either btw.

Founder & Legally Accountable Publisher of Red Line Games.
Environment & Gameplay Designer and Scripter.
http://moddb.com/mods/in-lucys-eyes
03-28-2012, 04:59 PM
Find
SilentStriker Offline
Posting Freak

Posts: 950
Threads: 26
Joined: Jul 2011
Reputation: 43
#4
RE: HELP ME! My scripting seems right but doesn't work. Please Help.

here's the problem..

"ItemName_firstdoorkey"
"ItemDesc_firstdoorkey"


you forgot the "



(This post was last modified: 03-28-2012, 05:16 PM by SilentStriker.)
03-28-2012, 05:15 PM
Find
Wapez Offline
Senior Member

Posts: 360
Threads: 37
Joined: Mar 2012
Reputation: 19
#5
RE: HELP ME! My scripting seems right but doesn't work. Please Help.

(03-28-2012, 05:15 PM)SilentStriker Wrote: here's the problem..

"ItemName_firstdoorkey"
"ItemDesc_firstdoorkey"


you forgot the "
Thanks alot man, but it still won't work.


Founder & Legally Accountable Publisher of Red Line Games.
Environment & Gameplay Designer and Scripter.
http://moddb.com/mods/in-lucys-eyes
03-28-2012, 05:40 PM
Find
SilentStriker Offline
Posting Freak

Posts: 950
Threads: 26
Joined: Jul 2011
Reputation: 43
#6
RE: HELP ME! My scripting seems right but doesn't work. Please Help.

Name the key firstdoorkey on both the name and the customsubitemtypename

03-28-2012, 05:44 PM
Find
Wapez Offline
Senior Member

Posts: 360
Threads: 37
Joined: Mar 2012
Reputation: 19
#7
RE: HELP ME! My scripting seems right but doesn't work. Please Help.

(03-28-2012, 05:44 PM)SilentStriker Wrote: Name the key firstdoorkey on both the name and the customsubitemtypename
I made some changes to the scripts:


<LANGUAGE>
<CATEGORY Name="TutorialStory">
<Entry Name="Description">This is a tutorial story. [br] [br]I hope you like it! Big Grin </Entry>
</CATEGORY>
<CATEGORY Name="Inventory">
<Entry Name="ItemDesc_Key1">Unlocks The Locked Door</Entry>
<Entry Name="ItemName_Key1">Key To Locked Door</Entry>
</CATEGORY>
<CATEGORY Name="Journal">
<Entry Name="Note_01_Name">Welcome.</Entry>
<Entry Name="Note_01_Text">You shall die...</Entry>
</CATEGORY>
</LANGUAGE>
_________________________________________________________________________________


//===========================================
// Starter's Script File!
//===========================================

//===========================================
// This runs when the map first starts
void OnStart()
{
AddUseItemCallback("", "Key1", "Door1", "UsedKeyOnDoor", true);
}

void UsedKeyOnDoor(string &in item, string &in door)
{
SetSwingDoorLocked(Door1, false, true);
PlaySoundAtEntity("", "unlock_door", Door1, 0, false);
RemoveItem(Key1);
}

//===========================================
// This runs when the player enters the map
void OnEnter()
{
}
//===========================================
// This runs when the player leaves the map
void OnLeave()
{
}

I have the same name in the customsubitemtypename... When i pick up the key it just says: "Picked up", the door is still unlocked, and the notes is blank. I'm thinking it might be something else, not the scripts.

Founder & Legally Accountable Publisher of Red Line Games.
Environment & Gameplay Designer and Scripter.
http://moddb.com/mods/in-lucys-eyes
(This post was last modified: 03-28-2012, 06:06 PM by Wapez.)
03-28-2012, 06:06 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#8
RE: HELP ME! My scripting seems right but doesn't work. Please Help.

Item names and descriptions.

The door will forever be unlocked until you first lock it somewhere else (either through the script or level editor).

Tutorials: From Noob to Pro
03-28-2012, 06:25 PM
Website Find
Wapez Offline
Senior Member

Posts: 360
Threads: 37
Joined: Mar 2012
Reputation: 19
#9
RE: HELP ME! My scripting seems right but doesn't work. Please Help.

(03-28-2012, 06:25 PM)Your Computer Wrote: Item names and descriptions.

The door will forever be unlocked until you first lock it somewhere else (either through the script or level editor).
Yes, i locked it, and the key has a name in the game. But i can't unlock the door. Do i have to do something more with the door in level editor than just changing the name?

Founder & Legally Accountable Publisher of Red Line Games.
Environment & Gameplay Designer and Scripter.
http://moddb.com/mods/in-lucys-eyes
03-28-2012, 06:50 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#10
RE: HELP ME! My scripting seems right but doesn't work. Please Help.

(03-28-2012, 06:50 PM)Wapez Wrote: Yes, i locked it, and the key has a name in the game. But i can't unlock the door. Do i have to do something more with the door in level editor than just changing the name?

I have no idea what kind of door you're trying to unlock, but if you're trying to unlock level doors with swing door functions, then it's not going to work. Also, if the script you're using is the one you posted recently, then the engine should have complained that Door1 and Key1 were not properly declared. In other words, you tried to use non-existing variables in place of existing variables or values.

Tutorials: From Noob to Pro
03-28-2012, 07:16 PM
Website Find




Users browsing this thread: 2 Guest(s)