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)
Mudbill Offline
Muderator

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

I understand you want some text to appear when the character walks into an area?
That should be simple.

First, create the ScriptArea in your level.

In your script, within your OnStart function, add a collision callback between the player and the area, like so:

PHP Code: (Select All)
void OnStart()
{
    
AddEntityCollideCallback("ScriptArea""Player""CallbackName"true1);


Make sure "ScriptArea" matches the name of your in-level area. "CallbackName" can be whatever as long as it matches below.

Below that, create the callback which tells the script what will happen when these two collide. Use SetMessage to display some text in the middle of the screen.

PHP Code: (Select All)
void CallbackName(string &in asParentstring &in asChildint alState)
{
    
SetMessage("MessageCategory""MessageEntry"0);


"MessageCategory" refers to a category within your extra_english.lang file. "MessageEntry" refers to an entry within that category. Are you familiar with the lang file?

It should look somewhat like this in your lang file, but you might already have some of it. If that's the case, exclude it from here:

PHP Code: (Select All)
<LANGUAGE>
    <
CATEGORY Name="CategoryName">
        <
Entry Name="EntryName">Put the text that you want to display inside here.</Entry>
    </
CATEGORY>
</
LANGUAGE

Most likely you already have the <LANGUAGE> tags in your lang file. If so, don't add them again.

(This post was last modified: 02-14-2016, 07:44 PM by Mudbill.)
02-14-2016, 07:41 PM
Find


Messages In This Thread
How make this script? (SOLVED) - by Abihishi - 02-14-2016, 06:11 PM
RE: How make this script? - by Mudbill - 02-14-2016, 07:41 PM
RE: How make this script? - by Abihishi - 02-14-2016, 07:57 PM
RE: How make this script? - by Romulator - 02-14-2016, 08:32 PM
RE: How make this script? - by Mudbill - 02-14-2016, 08:34 PM
RE: How make this script? - by Abihishi - 02-14-2016, 08:47 PM
RE: How make this script? - by Mudbill - 02-14-2016, 08:51 PM
RE: How make this script? - by Abihishi - 02-14-2016, 08:54 PM
RE: How make this script? - by Mudbill - 02-14-2016, 11:53 PM
RE: How make this script? - by Abihishi - 02-15-2016, 03:12 PM
RE: How make this script? - by Daemian - 02-16-2016, 12:46 AM
RE: How make this script? - by Spelos - 02-16-2016, 08:48 AM
RE: How make this script? - by Abihishi - 02-16-2016, 03:17 PM
RE: How make this script? - by Mudbill - 02-16-2016, 03:26 PM
RE: How make this script? - by Romulator - 02-16-2016, 03:55 PM
RE: How make this script? - by Abihishi - 02-16-2016, 04:09 PM
RE: How make this script? - by Spelos - 02-16-2016, 05:07 PM
RE: How make this script? - by Abihishi - 02-16-2016, 05:38 PM
RE: How make this script? - by Spelos - 02-16-2016, 06:15 PM
RE: How make this script? - by Abihishi - 02-16-2016, 07:44 PM
RE: How make this script? - by Mudbill - 02-16-2016, 10:09 PM



Users browsing this thread: 1 Guest(s)