![]() |
if (playerchats) question
I've been working on my house level in graal kingdoms (my first experience with level design/scripting NPCs), and I'd like to make it so an NPC acts when I say a certain word. Right now I can have it act whenever I say anything with the
if (playerchats) { } command, but I'd like it to act when I say a specific word rather than any word. I've been trying to figure it out by watching some of your videos/reading guides but I can't get the solution to my specific issue, and I thought you'd be the one to ask. Thanks for your help! |
First of all, try learning GS2 instead of using GS1. In GS2 you'd do:
PHP Code:
PHP Code:
|
Graal has used two main scripting languages to date: GScript 1 (GS1) and GScript 2 (GS2). We now exclusively use GS2, which is the newest (and much improved) scripting language. Tig won't accept your level upload unless your scripts are written in GS2.
Events like "playerChats" which use an if-statement are using a GS1 convention, which should be avoided in new code. It's simple to write it in GS2: PHP Code:
The property you're looking for is the player's chat; this is written simply as "player.chat": PHP Code:
PHP Code:
edit: ziro beat me to it, but I'll leave this here as it provides a bit more info on getting started w/ GScript |
Quote:
|
Quote:
might be a different case with rumours of this new level editor I'm hearing about. |
Quote:
|
All times are GMT +2. The time now is 08:27 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.