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
Message pop-up with script area collution
naseem142 Offline
Member

Posts: 153
Threads: 19
Joined: Oct 2012
Reputation: 0
#1
Message pop-up with script area collution

I'v made a message to pop-up , but the message doesn't pop-up when i "collide" with the script area.
Please tell me where was i wrong.

Code:


void OnStart()

{

AddUseItemCallback("", "key_1", "locked_door1", "UsedKeyOnDoor", true);
AddEntityCollideCallback("Player", "explode_scare", "Explode", true, 1);
SetEntityCallbackFunc("key_1", "OnPickup");
AddEntityCollideCallback("Player", "Message_1", "Message1", true, 1);

}

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

{

SetSwingDoorLocked("locked_door1", false, true);

PlaySoundAtEntity("", "unlock_door.snt", "locked_door1", 0, false);

RemoveItem("key_1");

}

void OnPickup(string &in asEntity, string &in type)
{
SetEntityActive("servant_grunt_1", true);
AddTimer("", 15.0f, "GruntDisable");
ShowEnemyPlayerPosition("servant_grunt_1");

}
void GruntDisable(string &in asTimer)
{
SetEntityActive("servant_grunt_1", false);
}
void DoorLockedPlayer(string &in entity)


{
if(GetSwingDoorLocked("gruntdoorss") == true)
{

SetMessage("Messages", "gruntdoor", 2);

}
}

//////////////////////////////////////////////////////////////////

void OnEnter()


{

AddUseItemCallback("", "trap", "locked_door1", "Trapitup", true);

SetEntityCallbackFunc("trap", "OnPickup1");

}

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

{

SetSwingDoorLocked("locked_door1", false, true);

PlaySoundAtEntity("", "unlock_door.snt", "locked_door1", 0, false);

RemoveItem("trap");

}

void OnPickup1(string &in asEntity, string &in type)
{
SetEntityActive("1", true);
ShowEnemyPlayerPosition("1");
SetEntityActive("2", true);
ShowEnemyPlayerPosition("2");
SetEntityActive("3", true);
ShowEnemyPlayerPosition("3");
SetEntityActive("4", true);
ShowEnemyPlayerPosition("4");
SetEntityActive("5", true);
ShowEnemyPlayerPosition("5");

}

void Message1(string &in asChild, string &in asParent, int alState)
{
SetMessage("Messages", "Popup1", 0);
}

////////////////////////////////////////////////////////////////////////////////////


void Explode(string &in asParent, string &in asChild, int alState)
{
SetPropHealth("vase_1", 0);
SetPropHealth("vase_2", 0);
}

//////////////////////////////////////////////////////////////////////////////////////
10-09-2012, 05:12 PM
Website Find
Adny Offline
Posting Freak

Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation: 173
#2
RE: Message pop-up with script area collution

Everything in this script looks okay (aside from the obscure spacing in functions). Can you post your extra_english.lang file?

I rate it 3 memes.
10-09-2012, 05:19 PM
Find
naseem142 Offline
Member

Posts: 153
Threads: 19
Joined: Oct 2012
Reputation: 0
#3
RE: Message pop-up with script area collution

(10-09-2012, 05:19 PM)andyrockin123 Wrote: Everything in this script looks okay (aside from the obscure spacing in functions). Can you post your extra_english.lang file?

<LANGUAGE>

<CATEGORY Name="CustomStoryMain">
<Entry Name="Description">Testing out my game</Entry>
</CATEGORY>

<CATEGORY Name="LoadingText">
<Entry Name="Loading ..... LOL!"> </Entry>


<CATEGORY Name="Sign">

</CATEGORY>


<CATEGORY Name="Levels">
<Entry Name="draussen">Outside</Entry>
</CATEGORY>


<CATEGORY Name="verschlossen">

</CATEGORY>



<CATEGORY Name="Flashbacks">

</CATEGORY>


<CATEGORY Name="Ending">
<Entry Name="end">
Made by naseem
[br]
Special Thanks
[br]
me
[br]
Thank you for Playing my Story
[br]
</Entry>
</CATEGORY>

////////////////////////////////////////////////////////////////////////////////////

<CATEGORY Name="Guardmsg">
<Entry Name="Description">Description</Entry>
</CATEGORY>
<CATEGORY Name="Inventory">


</CATEGORY>
<CATEGORY Name="Messages">
<Entry Name="Popup1">I must get the keys without waking him up ...</Entry>
</CATEGORY>
<CATEGORY Name="Descriptions">


</CATEGORY>
<CATEGORY Name="Levels">


</CATEGORY>


</LANGUAGE>
10-09-2012, 05:25 PM
Website Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#4
RE: Message pop-up with script area collution

You have a lot of unfilled categories... try deleting them.

Trying is the first step to success.
10-09-2012, 05:33 PM
Find
Adny Offline
Posting Freak

Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation: 173
#5
RE: Message pop-up with script area collution

The lang file had a few errors (some known to crash/not work, others minor that should still be fixed). The issues are bolded in the lang file:

Spoiler below!


<LANGUAGE>

<CATEGORY Name="CustomStoryMain">
<Entry Name="Description">Testing out my game</Entry>
</CATEGORY>

<CATEGORY Name="LoadingText">
<Entry Name="Loading ..... LOL!"></Entry>
</CATEGORY> ///here, you didn't have a /category.

<CATEGORY Name="Sign">

</CATEGORY>

<CATEGORY Name="Levels">
<Entry Name="draussen">Outside</Entry>
</CATEGORY>

<CATEGORY Name="verschlossen">

</CATEGORY>

<CATEGORY Name="Flashbacks">

</CATEGORY>

<CATEGORY Name="Ending">
<Entry Name="end">Made by naseem[br]Special Thanks[br]me[br]Thank you for Playing my Story[br]</Entry> ///weird spacing error here, don't press enter in the middle of entries, just use [br]
</CATEGORY>

<CATEGORY Name="Guardmsg">
<Entry Name="Description">Description</Entry>
</CATEGORY>

<CATEGORY Name="Inventory">

</CATEGORY>

<CATEGORY Name="Messages">
<Entry Name="Popup1">I must get the keys without waking him up ...</Entry>
</CATEGORY>

<CATEGORY Name="Descriptions">

</CATEGORY>

<CATEGORY Name="Levels">

</CATEGORY>


</LANGUAGE>


Be sure to erase your original lang, copy/paste this in, and delete all of the bolded text.

Hope that helped!

I rate it 3 memes.
10-09-2012, 05:35 PM
Find
naseem142 Offline
Member

Posts: 153
Threads: 19
Joined: Oct 2012
Reputation: 0
#6
RE: Message pop-up with script area collution

(10-09-2012, 05:35 PM)andyrockin123 Wrote: The lang file had a few errors (some known to crash/not work, others minor that should still be fixed). The issues are bolded in the lang file:

Spoiler below!





Testing out my game




///here, you didn't have a /category.






Outside











Made by naseem[br]Special Thanks[br]me[br]Thank you for Playing my Story[br] ///weird spacing error here, don't press enter in the middle of entries, just use [br]



Description







I must get the keys without waking him up ...














Be sure to erase your original lang, copy/paste this in, and delete all of the bolded text.

Hope that helped!

Thank you Big Grin
By the way , do you know how do i make a door that leads to the next map?
I don't want to create another thread. Big Grin
10-09-2012, 05:43 PM
Website Find
Adny Offline
Posting Freak

Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation: 173
#7
RE: Message pop-up with script area collution

(10-09-2012, 05:43 PM)naseem142 Wrote: By the way , do you know how do i make a door that leads to the next map?
I don't want to create another thread. Big Grin
Entities>Doors -- in there are a few doors with the prefix "level" (i.e. level_cellar, level_cistern, etc.) These doors have options under their second tab that allows you to put in information so you can change levels.

The bare minimum is the map file of the next level (which I think you browse for in the level editor). There are additional options such as making a name for the door (which requires a lang entry) and what sounds are made when you leave/enter.

Good luck :3

I rate it 3 memes.
10-09-2012, 05:49 PM
Find
Robby Offline
Posting Freak

Posts: 2,549
Threads: 38
Joined: Jun 2009
Reputation: 47
#8
RE: Message pop-up with script area collution

You use a "Level_door" from the entities tab. Select the "door" tab in there, and look for doors that have "level_" in their name.

That, unless I remember incorrectly.

Ninja'd.

Infrequently active. Don't expect an immediate response. Best to contact me at a different locale. If I create a thread, expect me to be quite active.
(This post was last modified: 10-09-2012, 05:49 PM by Robby.)
10-09-2012, 05:49 PM
Website Find
naseem142 Offline
Member

Posts: 153
Threads: 19
Joined: Oct 2012
Reputation: 0
#9
RE: Message pop-up with script area collution

(10-09-2012, 05:49 PM)andyrockin123 Wrote:
(10-09-2012, 05:43 PM)naseem142 Wrote: By the way , do you know how do i make a door that leads to the next map?
I don't want to create another thread. Big Grin
Entities>Doors -- in there are a few doors with the prefix "level" (i.e. level_cellar, level_cistern, etc.) These doors have options under their second tab that allows you to put in information so you can change levels.

The bare minimum is the map file of the next level (which I think you browse for in the level editor). There are additional options such as making a name for the door (which requires a lang entry) and what sounds are made when you leave/enter.

Good luck :3


Thank you x3
10-09-2012, 05:54 PM
Website Find




Users browsing this thread: 1 Guest(s)