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
How make this script? (SOLVED)
Daemian Offline
Posting Freak

Posts: 1,129
Threads: 42
Joined: Dec 2012
Reputation: 49
#11
RE: How make this script?

add a debug message to check your function. (hey guys)

02-16-2016, 12:46 AM
Find
Spelos Away
Banned

Posts: 231
Threads: 19
Joined: Sep 2014
#12
RE: How make this script?

@Abihishi

The second callback looks correct. If the message doesn't display, the problem won't be in the .hps file. Make sure that your extra_english.lang file contains:

PHP Code: (Select All)
<CATEGORY Name="MessageCategory">
<
Entry Name="MessageEntry">My text</Entry>
</
CATEGORY

Since your .hps refers to it.

Check for misspelling.

More details:
Spoiler below!


In your .hps file:

SetMessage("MessageCategory", "MessageEntry", 0);


Does have to correspond to category and entry in your .lang file:

<CATEGORY Name="MessageCategory">
<Entry Name="MessageEntry">My text</Entry>
</CATEGORY>


(This post was last modified: 02-16-2016, 09:04 AM by Spelos.)
02-16-2016, 08:48 AM
Find
Abihishi Offline
Junior Member

Posts: 44
Threads: 8
Joined: Feb 2016
Reputation: 0
#13
RE: How make this script?

void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea", "Scrypt1", true, 1);
}

void Scrypt1(string &in asParent, string &in asChild, int alState)
{
SetMessage("MessageCategory", "MessageEntry", 0);
}

In lang file:

CATEGORY Name="MessageCategory">
<Entry Name="MessageEntry">My text</Entry>
</CATEGORY>

And not work. I no see item name, description etc.

I dont know, maybe i download and play custom stories and maybe I encounter in this "simply" script.

Bye
02-16-2016, 03:17 PM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#14
RE: How make this script?

Does your other key script work? I'm asking because if not, then the issue might be that your script file is improperly formatted and not recognized. Though, if you received errors previously in this thread, that's probably not it.

(This post was last modified: 02-16-2016, 03:26 PM by Mudbill.)
02-16-2016, 03:26 PM
Find
Romulator Offline
Not Tech Support ;-)

Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation: 195
#15
RE: How make this script?

Is your ScriptArea in the Level Editor actually named "ScriptArea"? Whatever it is named, should match your code.

Discord: Romulator#0001
[Image: 3f6f01a904.png]
02-16-2016, 03:55 PM
Find
Abihishi Offline
Junior Member

Posts: 44
Threads: 8
Joined: Feb 2016
Reputation: 0
#16
RE: How make this script?

@Mudbill

Jumpscare script and key work.

@Romulator Yes, named is same, I checked this Five times Smile
(This post was last modified: 02-16-2016, 05:46 PM by Abihishi.)
02-16-2016, 04:09 PM
Find
Spelos Away
Banned

Posts: 231
Threads: 19
Joined: Sep 2014
#17
RE: How make this script?

Right...

If this is your full .lang file:
Spoiler below!

PHP Code: (Select All)
<CATEGORY Name="CustomStoryMain">
<
Entry Name="Description"Description custom story </Entry>
</
CATEGORY>

----------
Notatki/Myśli----------
<
CATEGORY Name="Journal">

<
Entry Name="Note_voice_Name">Name Note</Entry>
<
Entry Name="Note_voice_Text">[voice Voice1.ogg][brText</Entry>


<
Entry Name="Quest_mementos1_Text">I must find key in bathroom.</Entry>
</
CATEGORY>

----------
Nazwy I Opisy Przedmiotów----------
<
CATEGORY Name="Inventory">
<
Entry Name="ItemName_KeyDesc"Bathroom Key</Entry>
<
Entry Name="ItemDesc_KeyDesc"Olddusty keyUsed of peple thereof manor house.</Entry>

</
CATEGORY>
<
CATEGORY Name="CategoryName">
<
Entry Name="EntryName">My text</Entry>
</
CATEGORY>

</
LANGUAGE


Then there's two main things wrong.
You have to start with <LANGUAGE> and the comments need to have other syntax.

This should be corrected .lang file:
Spoiler below!

PHP Code: (Select All)
<LANGUAGE>
    <
CATEGORY Name="CustomStoryMain">
        <
Entry Name="Description"Description custom story </Entry>
    </
CATEGORY>

    <!-- 
Notatki/Myśli -->
    <
CATEGORY Name="Journal">
        <
Entry Name="Note_voice_Name">Name Note</Entry>
        <
Entry Name="Note_voice_Text">[voice Voice1.ogg][brText</Entry>

        <
Entry Name="Quest_mementos1_Text">I must find key in bathroom.</Entry>
    </
CATEGORY>

    <!-- 
Nazwy I Opisy Przedmiotów -->
    <
CATEGORY Name="Inventory">
        <
Entry Name="ItemName_KeyDesc"Bathroom Key</Entry>
        <
Entry Name="ItemDesc_KeyDesc"Olddusty keyUsed of peple thereof manor house.</Entry>
    </
CATEGORY>
    
    <
CATEGORY Name="CategoryName">
        <
Entry Name="EntryName">My text</Entry>
    </
CATEGORY>
</
LANGUAGE


If the problem is still there, classic mistakes are:
  • Categories that don't end or have wrong structure
    Make sure that every category begins and ends withing <LANGUAGE> tags.
    Make sure that the spelling is ok.

  • Missing end of Language
    <LANGUAGE> does have to be the first thing of the file and </LANGUAGE> the last.

  • Leaving plain text
    Sometimes it happens. You copy something and leave if in there. Anything that doesn't belong to anything else needs to go away.
    Remember that //Comment is not the correct syntax for comments in .lang.
    <!-- Comment --> is the one.

  • Missing quotes
    In entry's and category's name it's required!

  • Duplicate Categories
    Make sure there are no duplicate categories with the same name.

  • Misspelled the .lang file itself.
    It does need to be "extra_english.lang"

  • Wrong type of document
    Make sure it's "extra_english.lang" not "extra_english.lang.txt"
    Choose save as... and make sure you select save as "all types" and include the .lang.
(This post was last modified: 02-16-2016, 05:16 PM by Spelos.)
02-16-2016, 05:07 PM
Find
Abihishi Offline
Junior Member

Posts: 44
Threads: 8
Joined: Feb 2016
Reputation: 0
#18
RE: How make this script?

Ok, i repair. I make new notate and i forgot write </Entry> in end.

But my script not work (this text,) but my jumpscare script work.
02-16-2016, 05:38 PM
Find
Spelos Away
Banned

Posts: 231
Threads: 19
Joined: Sep 2014
#19
RE: How make this script?

I know you said you checked it about 5 times, but:

You mentioned that your Area (in the Level Editor) is called "Skrypt 1".

Abihishi Wrote:In game my script area is Skrypt 1, but this not work.

You also have something like this in your .hps file:
PHP Code: (Select All)
void OnStart()
{
    
AddEntityCollideCallback("Player""ScriptArea""Scrypt1"true1);


This in plain language means that if:
Player touches an area called: ScriptArea, it will do Scrypt1 function.

Are you really really sure your area is "ScriptArea" and not "Skrypt 1"?

Also... I would advise you to rename the in Level Editor script Area to something more descriptive, like "CorridorArea".

Changing the Area's name:
Spoiler below!
  • Rename the Area in your Level Editor
    Make sure the name doesn't use special character and I would even stay away from spaces.
  • Correct the callback to reflect changes
    Let's say you rename the area to "MyScriptAreaInLevelEditor" (without the quotation marks!), the script should then look like this:
    PHP Code: (Select All)
    void OnStart()
    {
        
    AddEntityCollideCallback("Player""MyScriptAreaInLevelEditor""Scrypt1"true1);
    }

    void Scrypt1(string &in asParentstring &in asChildint alState)
    {
        
    SetMessage("MessageCategory""MessageEntry"0);



If it still doesn't work:
- Post your .hps content in it's FULL length and it's current state.
- Add the names of all script Areas that you use in your Level Editor
- Specify what it is supposed to do and what it's doing

I'm really scraping the bottom of the barrel here.
(This post was last modified: 02-16-2016, 06:34 PM by Spelos.)
02-16-2016, 06:15 PM
Find
Abihishi Offline
Junior Member

Posts: 44
Threads: 8
Joined: Feb 2016
Reputation: 0
#20
RE: How make this script?

Ok, so i change all as you said and.... WORK!

God donuts, really I'm stupid. My script in editor is Script1 and this not work. I thought, that this is script named and script area named.

Really thanks for you Spelos, and all guys who tried me help!
Bye Wink

(to the next error : D)
02-16-2016, 07:44 PM
Find




Users browsing this thread: 1 Guest(s)