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
Script Help Cant see the error :S
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#11
RE: Cant see the error :S

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()
{

}

"Veni, vidi, vici."
"I came, I saw, I conquered."
05-25-2013, 03:46 PM
Find
Darkboot Offline
Junior Member

Posts: 31
Threads: 8
Joined: Jun 2012
Reputation: 0
#12
RE: Cant see the error :S

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?
(This post was last modified: 05-25-2013, 04:30 PM by Darkboot.)
05-25-2013, 04:30 PM
Find
Romulator Offline
Not Tech Support ;-)

Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation: 195
#13
RE: Cant see the error :S

(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.

Discord: Romulator#0001
[Image: 3f6f01a904.png]
05-25-2013, 04:41 PM
Find
Darkboot Offline
Junior Member

Posts: 31
Threads: 8
Joined: Jun 2012
Reputation: 0
#14
RE: Cant see the error :S

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..
(This post was last modified: 05-25-2013, 06:08 PM by Darkboot.)
05-25-2013, 06:04 PM
Find
OriginalUsername Offline
Posting Freak

Posts: 896
Threads: 42
Joined: Feb 2013
Reputation: 34
#15
RE: Cant see the error :S

Off topic: Please don't make a story for PDP. There is a 1% he'll play it. (Not being mean, just realistic)
05-25-2013, 06:55 PM
Find
Darkboot Offline
Junior Member

Posts: 31
Threads: 8
Joined: Jun 2012
Reputation: 0
#16
RE: Cant see the error :S

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?
05-25-2013, 08:04 PM
Find
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#17
RE: Cant see the error :S

<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.

"Veni, vidi, vici."
"I came, I saw, I conquered."
05-26-2013, 02:02 AM
Find
pewds..fan Offline
Junior Member

Posts: 11
Threads: 4
Joined: May 2013
Reputation: 0
#18
RE: Cant see the error :S

brackets
06-01-2013, 09:04 AM
Find
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#19
RE: Cant see the error :S

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

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

"Veni, vidi, vici."
"I came, I saw, I conquered."
06-01-2013, 10:09 AM
Find




Users browsing this thread: 2 Guest(s)