Frictional Games Forum (read-only)
[SCRIPT] Cant see the error :S - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: [SCRIPT] Cant see the error :S (/thread-21605.html)

Pages: 1 2


RE: Cant see the error :S - PutraenusAlivius - 05-25-2013

void OnStart()
{
AddUseItemCallback("", "awesomekey_1", "mansion_1", "UsedKeyOnDoor", true);
GiveItemFromFile("lantern", "lantern.ent");
AddEntityCollideCallback("Player", "enemy_spawner_1", "monsterActive", true, 1);
AddEntityCollideCallback("Player", "PlayerStartArea_1", "Restart", true, 1);
}

void monsterActive(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("enemy_spawner_2", true);
AddEnemyPatrolNode("enemy_spawner_1", "PathNodeArea_1", 0.0f, "");
AddEnemyPatrolNode("enemy_spawner_1", "PathNodeArea_2", 1.0f, "");
AddEnemyPatrolNode("enemy_spawner_1", "PathNodeArea_1", 1.0f, "");
AddEnemyPatrolNode("enemy_spawner_1", "PathNodeArea_4", 1.0f, "");
AddEnemyPatrolNode("enemy_spawner_1", "PathNodeArea_5", 1.0f, "");
AddEnemyPatrolNode("enemy_spawner_1", "PathNodeArea_6", 1.0f, "");
AddEnemyPatrolNode("enemy_spawner_1", "PathNodeArea_7", 1.0f, "");
}

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

void OnEnter()

{
FadeOut(0.0f);
FadeIn(5.0f);
}


void OnLeave()
{

}


RE: Cant see the error :S - Darkboot - 05-25-2013

okey so i fixed that thing. the enemy goes to the pathnodes now and what i want now is that i want description on the main when starting a custom story and a description for the key cause when i pick it up it stand " picked up " and no description on it

Lang file:
<CATEGORY Name="CustomStoryMain">
<Entry Name="Description">First test</Entry>
</CATEGORY>
<CATEGORY Name="Inventory">
<Entry Name="ItemName_Awesomekey">Awesome Key</Entry>
<Entry Name="ItemDesc_Awesomekey">Key for an awesome door to an awesome room in an awesome level</Entry>
</CATEGORY>

And im gonna make Another key to open a closet and i wonder if i can put the script in the same Place as this;

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

or do i need to make Another

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
something
}

and so on for the other key?


RE: Cant see the error :S - Romulator - 05-25-2013

(05-25-2013, 04:30 PM)Darkboot Wrote: okey so i fixed that thing. the enemy goes to the pathnodes now and what i want now is that i want description on the main when starting a custom story and a description for the key cause when i pick it up it stand " picked up " and no description on it

Lang file:
<CATEGORY Name="CustomStoryMain">
<Entry Name="Description">First test</Entry>
</CATEGORY>
<CATEGORY Name="Inventory">
<Entry Name="ItemName_Awesomekey">Awesome Key</Entry>
<Entry Name="ItemDesc_Awesomekey">Key for an awesome door to an awesome room in an awesome level</Entry>
</CATEGORY>

And im gonna make Another key to open a closet and i wonder if i can put the script in the same Place as this;

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

or do i need to make Another

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
something
}

and so on for the other key?

For your .lang file, put <LANGUAGE> at the very start and </LANGUAGE> at the end. You also need to go to the Level Editor, click on your key, click the Entities tab then change the Name (should be the last one) to the name of your key, which in this case is "Awesomekey"

For the script, yes you'll need a separate one because you're using a different key on a different door. Just add another UseItemCallback with the new key, other door and what script to perform.


RE: Cant see the error :S - Darkboot - 05-25-2013

the keys name in entites is " Awesomekey " like in the .lang file but still no desc or name when i pick it up and.. the description for the custom map isnt working, i can change Picture but not description? :S iv'e looked its even the same as Another one (the other one is working)

MY LANG:
<LANGUAGE>
<CATEGORY Name="CustomStoryMain">
<Entry Name="Description">First test</Entry>
</CATEGORY>
<CATEGORY Name="Inventory">
<Entry Name="ItemName_Awesomekey">Awesome Key</Entry>
<Entry Name="ItemDesc_Awesomekey">Key for an awesome door to an awesome room in an awesome level</Entry>
</LANGUAGE>




THE OTHER LANG FILE (pewdiepies nightmare 1):

<LANGUAGE>
<RESOURCES>
</RESOURCES>
<CATEGORY Name="CustomStoryMain">
<Entry Name="Description">
You are the ledgendary man PewDiePie, In his dreams the world gets uncontrolable. (*Thats what she said*) Now you need to fight the Bro and the Evil Barrels. Lets begin, hero!
</Entry>

Its not really the same but ive tried like that but still nothing..


RE: Cant see the error :S - OriginalUsername - 05-25-2013

Off topic: Please don't make a story for PDP. There is a 1% he'll play it. (Not being mean, just realistic)


RE: Cant see the error :S - Darkboot - 05-25-2013

I took that one as example i dont gonna use it

but just so you understand why i dont get it :S its the same, why isnt working for me?


RE: Cant see the error :S - PutraenusAlivius - 05-26-2013

<LANGUAGE>
<CATEGORY Name="CustomStoryMain">
<Entry Name="Description">First test</Entry>
</CATEGORY>
<CATEGORY Name="Inventory">
<Entry Name="ItemName_Awesomekey">Awesome Key</Entry>
<Entry Name="ItemDesc_Awesomekey">Key for an awesome door to an awesome room in an awesome level</Entry>
</CATEGORY>
</LANGUAGE>

It's now fixed.
[ERRORS: You're missing a closing category brace for Inventory]
If it still doesn't show up, make sure everything is named properly.


RE: Cant see the error :S - pewds..fan - 06-01-2013

brackets


RE: Cant see the error :S - PutraenusAlivius - 06-01-2013

(06-01-2013, 09:04 AM)pewds..fan Wrote: brackets

What? We are talking about the .lang file now. You don't need that.