Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support


Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I need help! D:
Author Message
7thProductions Offline
Junior Member

Posts: 42
Joined: Mar 2012
Reputation: 0
Post: #1
Exclamation I need help! D:

Does anyone see anything wrong with this extra_english.lang file?

<LANGUAGE>

<CATEGORY Name="CustomStoryMain">
<Entry Name="Description">test</Entry>
</CATEGORY>

<CATEGORY Name="Inventory">
<Entry Name="ItemName_storagekey">Storage Key</Entry>
<Entry Name="ItemDesc_storagekey">Tag reads: "Key for the upstairs storage room."</Entry>
</CATEGORY>

<CATEGORY Name="DA01Map01">
<Entry Name="AdrianShock">What...what the hell was that..!?</Entry>
</CATEGORY>

<CATEGORY Name="Journal">
</CATEGORY>

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

</LANGUAGE>

I've used SetMessage for "DA01Map01" and I've tried entering a custom Name and Description for a key, but nothing shows up in game and there doesn't seem to be any problems with the script.

Script:

void OnStart()
{
PlayMusic("general_rain_m.ogg", true, 1, 0, 1, true);
SetPlayerCrouching(true);
SetPlayerActive(false);
SetPlayerSanity(80.0);
SetPlayerLampOil(0.0);
SetInventoryDisabled(true);
FadeOut(0.0f);
FadeIn(5.0f);
SetPlayerSanity(1);
FadePlayerRollTo(-50, 220, 220);
AddTimer("Adrian_cough", 3, "situp");
AddTimer("Adrian_breath", 6, "situp");
AddTimer("Adrian_cough_2", 8, "situp");
AddTimer("Adrian_situp", 10, "situp");
AddTimer("monster_growl", 20, "scare");
AddTimer("father_scream", 21, "scare");
AddTimer("father_scream_cont", 22.5, "scare");
AddTimer("father_scream_cont_2", 23, "scare");
AddTimer("monster_hit", 25, "scare");
AddTimer("monster_growl_2", 27, "scare");
AddTimer("father_whimper", 28.5, "scare");
AddTimer("father_dies", 31.5, "scare");
AddTimer("father_dies_2", 34, "scare");
AddTimer("father_dies_3", 34.5, "scare");
AddTimer("drag", 35, "scare");
AddTimer("monster_leaves", 38, "scare");
AddTimer("endscare", 39.5, "scare");
}
void situp(string &in asTimer)
{
string x = asTimer;
if (x == "Adrian_cough")
{
PlaySoundAtEntity("", "player_cough.snt", "Player", 0, false);
FadeOut(3);
}

else if (x == "Adrian_breath")
{
FadeIn(3);
PlaySoundAtEntity("", "react_breath.snt", "Player", 0, false);
}

else if (x == "Adrian_cough_2")
{
PlaySoundAtEntity("", "player_cough.snt", "Player", 0, false);
FadeOut(3);
}

else if (x == "Adrian_situp")
{
FadeIn(3);
SetPlayerActive(true);
SetInventoryDisabled(false);
GiveSanityBoost();
FadePlayerRollTo(0, 33, 50);
}
}
void scare(string &in asTimer)
{
string x = asTimer;
if (x == "monster_growl")
{
PlaySoundAtEntity("", "react_scare.snt", "Player", 0, false);
PlaySoundAtEntity("", "amb_alert.snt", "Player", 0, false);
StartPlayerLookAt("ScriptArea_1", 5, 50, "");
}

else if (x == "father_scream")
{
PlaySoundAtEntity("", "attack_claw_hit.snt", "Player", 0, false);
PlaySoundAtEntity("", "29_scream.snt", "Player", 0, false);
}

else if (x == "father_scream_cont")
{
PlaySoundAtEntity("", "attack_claw_hit.snt", "Player", 0, false);
}

else if (x == "father_scream_cont_2")
{
PlaySoundAtEntity("", "attack_claw_hit.snt", "Player", 0, false);
}

else if (x == "monster_hit")
{
PlaySoundAtEntity("", "attack_claw_hit.snt", "Player", 0, false);
}

else if (x == "monster_growl_2")
{
PlaySoundAtEntity("", "amb_alert.snt", "Player", 0, false);
}

else if (x == "father_whimper")
{
PlaySoundAtEntity("", "15_prisoner_beg.snt", "Player", 0, false);
}

else if (x == "father_dies")
{
PlaySoundAtEntity("", "attack_claw_hit.snt", "Player", 0, false);
PlaySoundAtEntity("", "15_prisoner_scream.snt", "Player", 0, false);
}

else if (x == "father_dies_2")
{
PlaySoundAtEntity("", "attack_claw_hit.snt", "Player", 0, false);
PlaySoundAtEntity("", "15_prisoner_death.snt", "Player", 0, false);
}

else if (x == "father_dies_3")
{
StopPlayerLookAt();
PlaySoundAtEntity("", "scare_thump.snt", "Player", 0, false);
StartPlayerLookAt("ScriptArea_2", 1, 50, "");
}

else if (x == "drag")
{
PlaySoundAtEntity("", "15_drag_body.snt", "Player", 0, false);
}

else if (x == "monster_leaves")
{
PlaySoundAtEntity("", "door_level_wood_open.snt", "Player", 0, false);
}

else if (x == "endscare")
{
StopPlayerLookAt();
SetMessage("DA01Map01", "AdrianShock", 0);
}
}

I've had this problem for quite some time now and I can't (nor can anyone else) figure out what is wrong..I'm really excited about working on my first custom story, but this issue is a real setback and I'm in desperate need of an answer. :/
(This post was last modified: 04-14-2012 01:11 PM by 7thProductions.)
04-13-2012 12:19 AM
Find all posts by this user Quote this message in a reply
Cranky Old Man Offline
Posting Freak

Posts: 922
Joined: Apr 2012
Reputation: 37
Post: #2
RE: I need help! D:

It would help to know what sort of error we're looking for.
When and how does it not work?
Does it print some kind of error message?

Edit:
As far as I know, that extra_english.lang looks error-free. (I'm assuming that you've named the key "storagekey".)

Noob scripting tutorial: From Noob to Pro

(This post was last modified: 04-13-2012 12:34 AM by Cranky Old Man.)
04-13-2012 12:30 AM
Find all posts by this user Quote this message in a reply
7thProductions Offline
Junior Member

Posts: 42
Joined: Mar 2012
Reputation: 0
Post: #3
RE: I need help! D:

There is no error message; the map loads just fine. But SetMessage (which, according to the wiki, should display a message on the screen) won't work when it's supposed to at the end of the timer, the screen just remains blank, and when I use a CustomSubItemTypeName on a key in the level editor it only gets rid of the default name and description instead of showing the custom name and description.

And from what a tutorial told me, the name of the key and the CustomSubItemTypeName can be completely different, but you need to include the CustomSubItemTypeName in the LANG file. Is that wrong?
04-13-2012 12:54 AM
Find all posts by this user Quote this message in a reply
Cranky Old Man Offline
Posting Freak

Posts: 922
Joined: Apr 2012
Reputation: 37
Post: #4
RE: I need help! D:

(04-13-2012 12:54 AM)7thProductions Wrote:  There is no error message; the map loads just fine. But SetMessage (which, according to the wiki, should display a message on the screen) won't work when it's supposed to at the end of the timer, the screen just remains blank, and when I use a CustomSubItemTypeName on a key in the level editor it only gets rid of the default name and description instead of showing the custom name and description.

And from what a tutorial told me, the name of the key and the CustomSubItemTypeName can be completely different, but you need to include the CustomSubItemTypeName in the LANG file. Is that wrong?
Well, your line is probably working just fine.
SetMessage("DA01Map01", "AdrianShock", 0);
should display AdrianShock, in the DA01Map01 category, for 0 seconds.
Try "1.0f" instead. (Edit: Oh, didn't read the part about 0 setting it to text length. Try "0.0f".)

...and as for the key, that's correct: If a CustomSubItemTypeName of a key is "butler", then the entry names for that key should read "ItemName_butler" and "ItemDesc_butler". (The name is of course case sensitive, so "ItemName_Butler" wouldn't work.)


I'm at a loss with this. I'm not experienced enough. It could be that AngelScript has a limitation on the number of "else if" statements. It could be anything. You could test SetMessage outside the code and see if it works then.
Does your story find anything else in your lang file? Maybe the lang file is in a folder it shouldn't be in.

Noob scripting tutorial: From Noob to Pro

(This post was last modified: 04-13-2012 01:49 AM by Cranky Old Man.)
04-13-2012 01:37 AM
Find all posts by this user Quote this message in a reply
Putmalk Offline
Senior Member

Posts: 291
Joined: Apr 2012
Reputation: 15
Post: #5
RE: I need help! D:

Why not try taking out those unused categories for now (Journal, Levels). Your lang file (besides that) seems normal.

I would also like to help you out with your scripting a bit, to make it a bit more efficient:

Instead of spamming "if-else" statements, try using switch statements.

void func1(...)
{
//here I declare some timers, like you did, to the same function
}

void func2(string &in asTimer)
{

switch(asTimer)
{
  case "a":
    //stuff happens here
    //no "{" "}" brackets
  break;
  case "b":
  break;
  case "c":
  break;
}

}

That makes your code cleaner and easier to write. Just note that a, b, and c would be replaced by the names of your strings (case "adrian_breath").

(This post was last modified: 04-13-2012 01:55 AM by Putmalk.)
04-13-2012 01:51 AM
Find all posts by this user Quote this message in a reply
7thProductions Offline
Junior Member

Posts: 42
Joined: Mar 2012
Reputation: 0
Post: #6
Question RE: I need help! D:

(04-13-2012 01:37 AM)Cranky Old Man Wrote:  
(04-13-2012 12:54 AM)7thProductions Wrote:  There is no error message; the map loads just fine. But SetMessage (which, according to the wiki, should display a message on the screen) won't work when it's supposed to at the end of the timer, the screen just remains blank, and when I use a CustomSubItemTypeName on a key in the level editor it only gets rid of the default name and description instead of showing the custom name and description.

And from what a tutorial told me, the name of the key and the CustomSubItemTypeName can be completely different, but you need to include the CustomSubItemTypeName in the LANG file. Is that wrong?
Well, your line is probably working just fine.
SetMessage("DA01Map01", "AdrianShock", 0);
should display AdrianShock, in the DA01Map01 category, for 0 seconds.
Try "1.0f" instead. (Edit: Oh, didn't read the part about 0 setting it to text length. Try "0.0f".)

...and as for the key, that's correct: If a CustomSubItemTypeName of a key is "butler", then the entry names for that key should read "ItemName_butler" and "ItemDesc_butler". (The name is of course case sensitive, so "ItemName_Butler" wouldn't work.)


I'm at a loss with this. I'm not experienced enough. It could be that AngelScript has a limitation on the number of "else if" statements. It could be anything. You could test SetMessage outside the code and see if it works then.
Does your story find anything else in your lang file? Maybe the lang file is in a folder it shouldn't be in.
which folder does the extra_english.lang file have to be under?
04-14-2012 12:32 PM
Find all posts by this user Quote this message in a reply
Datguy5 Offline
Senior Member

Posts: 621
Joined: Dec 2011
Reputation: 12
Post: #7
RE: I need help! D:

(04-14-2012 12:32 PM)7thProductions Wrote:  
(04-13-2012 01:37 AM)Cranky Old Man Wrote:  
(04-13-2012 12:54 AM)7thProductions Wrote:  There is no error message; the map loads just fine. But SetMessage (which, according to the wiki, should display a message on the screen) won't work when it's supposed to at the end of the timer, the screen just remains blank, and when I use a CustomSubItemTypeName on a key in the level editor it only gets rid of the default name and description instead of showing the custom name and description.

And from what a tutorial told me, the name of the key and the CustomSubItemTypeName can be completely different, but you need to include the CustomSubItemTypeName in the LANG file. Is that wrong?
Well, your line is probably working just fine.
SetMessage("DA01Map01", "AdrianShock", 0);
should display AdrianShock, in the DA01Map01 category, for 0 seconds.
Try "1.0f" instead. (Edit: Oh, didn't read the part about 0 setting it to text length. Try "0.0f".)

...and as for the key, that's correct: If a CustomSubItemTypeName of a key is "butler", then the entry names for that key should read "ItemName_butler" and "ItemDesc_butler". (The name is of course case sensitive, so "ItemName_Butler" wouldn't work.)


I'm at a loss with this. I'm not experienced enough. It could be that AngelScript has a limitation on the number of "else if" statements. It could be anything. You could test SetMessage outside the code and see if it works then.
Does your story find anything else in your lang file? Maybe the lang file is in a folder it shouldn't be in.
which folder does the extra_english.lang file have to be under?
It has to be in your custom story folder.Not in the maps.(The same as custom story settings.cfg)

04-14-2012 12:41 PM
Find all posts by this user Quote this message in a reply
7thProductions Offline
Junior Member

Posts: 42
Joined: Mar 2012
Reputation: 0
Post: #8
Big Grin RE: I need help! D:

(04-14-2012 12:41 PM)Datguy5 Wrote:  
(04-14-2012 12:32 PM)7thProductions Wrote:  
(04-13-2012 01:37 AM)Cranky Old Man Wrote:  
(04-13-2012 12:54 AM)7thProductions Wrote:  There is no error message; the map loads just fine. But SetMessage (which, according to the wiki, should display a message on the screen) won't work when it's supposed to at the end of the timer, the screen just remains blank, and when I use a CustomSubItemTypeName on a key in the level editor it only gets rid of the default name and description instead of showing the custom name and description.

And from what a tutorial told me, the name of the key and the CustomSubItemTypeName can be completely different, but you need to include the CustomSubItemTypeName in the LANG file. Is that wrong?
Well, your line is probably working just fine.
SetMessage("DA01Map01", "AdrianShock", 0);
should display AdrianShock, in the DA01Map01 category, for 0 seconds.
Try "1.0f" instead. (Edit: Oh, didn't read the part about 0 setting it to text length. Try "0.0f".)

...and as for the key, that's correct: If a CustomSubItemTypeName of a key is "butler", then the entry names for that key should read "ItemName_butler" and "ItemDesc_butler". (The name is of course case sensitive, so "ItemName_Butler" wouldn't work.)


I'm at a loss with this. I'm not experienced enough. It could be that AngelScript has a limitation on the number of "else if" statements. It could be anything. You could test SetMessage outside the code and see if it works then.
Does your story find anything else in your lang file? Maybe the lang file is in a folder it shouldn't be in.
which folder does the extra_english.lang file have to be under?
It has to be in your custom story folder.Not in the maps.(The same as custom story settings.cfg)
thank you so much! Big Grin
04-14-2012 01:10 PM
Find all posts by this user Quote this message in a reply
Datguy5 Offline
Senior Member

Posts: 621
Joined: Dec 2011
Reputation: 12
Post: #9
RE: I need help! D:

(04-14-2012 01:10 PM)7thProductions Wrote:  
(04-14-2012 12:41 PM)Datguy5 Wrote:  
(04-14-2012 12:32 PM)7thProductions Wrote:  
(04-13-2012 01:37 AM)Cranky Old Man Wrote:  
(04-13-2012 12:54 AM)7thProductions Wrote:  There is no error message; the map loads just fine. But SetMessage (which, according to the wiki, should display a message on the screen) won't work when it's supposed to at the end of the timer, the screen just remains blank, and when I use a CustomSubItemTypeName on a key in the level editor it only gets rid of the default name and description instead of showing the custom name and description.

And from what a tutorial told me, the name of the key and the CustomSubItemTypeName can be completely different, but you need to include the CustomSubItemTypeName in the LANG file. Is that wrong?
Well, your line is probably working just fine.
SetMessage("DA01Map01", "AdrianShock", 0);
should display AdrianShock, in the DA01Map01 category, for 0 seconds.
Try "1.0f" instead. (Edit: Oh, didn't read the part about 0 setting it to text length. Try "0.0f".)

...and as for the key, that's correct: If a CustomSubItemTypeName of a key is "butler", then the entry names for that key should read "ItemName_butler" and "ItemDesc_butler". (The name is of course case sensitive, so "ItemName_Butler" wouldn't work.)


I'm at a loss with this. I'm not experienced enough. It could be that AngelScript has a limitation on the number of "else if" statements. It could be anything. You could test SetMessage outside the code and see if it works then.
Does your story find anything else in your lang file? Maybe the lang file is in a folder it shouldn't be in.
which folder does the extra_english.lang file have to be under?
It has to be in your custom story folder.Not in the maps.(The same as custom story settings.cfg)
thank you so much! Big Grin
Np dude

04-14-2012 01:23 PM
Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)