Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #16  
Old 04-11-2009, 01:23 PM
[email protected] sid.gottlieb@googlemail.com is offline
Banned
Join Date: Mar 2008
Posts: 861
sid.gottlieb@googlemail.com will become famous soon enough
Quote:
Originally Posted by Raelyn View Post
Question #7
I have several NPCs with the following script.

PHP Code:
if (created) {
  
setshape 1,32,16;
}

if (
playertouchsme){
  
say2 Says_stuff_here;

What is the GS2 equivalent for the say2 command? And is there something wrong about the functionality of this script (bad formatting aside)? Because I have 4 of them on the gmap, and two work, and two don't. All identical, the only difference is the sign text.
The GS2 way, have you read the wiki? (http://wiki.graal.net/index.php/Creation)
HTML Code:
player.say2("Stuff in here");
Reply With Quote
  #17  
Old 04-11-2009, 01:40 PM
Raelyn Raelyn is offline
the Professional.
Raelyn's Avatar
Join Date: Sep 2003
Location: Zormite
Posts: 964
Raelyn will become famous soon enough
Quote:
Originally Posted by [email protected] View Post
HTML Code:
player.say2("Stuff in here");
So I need player.say2? Or just say2 like Ziro posted?
__________________
*Don't let the door hit you on the way out.*
Reply With Quote
  #18  
Old 04-11-2009, 01:51 PM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Quote:
Originally Posted by Raelyn View Post
So I need player.say2? Or just say2 like Ziro posted?
Just say2.

After looking at the wiki it doesn't show that say2 is part of the player object, it is a global function.
__________________
Reply With Quote
  #19  
Old 04-11-2009, 01:53 PM
[email protected] sid.gottlieb@googlemail.com is offline
Banned
Join Date: Mar 2008
Posts: 861
sid.gottlieb@googlemail.com will become famous soon enough
It's serverside too... I'm using it as we speak
HTML Code:
function onActionDisplayStats() {
  temp.i = "#i(classic_bowlingpin_2.png)";
  temp.txt = "\n         " @ i SPC "Lane" SPC this.alleynum SPC "Scores" SPC i @ "\n\n";
  
  temp.players = this.onGetList();
  for (temp.p: temp.players) {
    temp.p = findPlayer(p);
    if (p.level.name != this.level.name) continue;
    
    temp.score = this.("score_" @ p.account); 
    temp.txt @= "#i(" @ p.headimg @ ", 0, 64, 32, 32)" SPC p.nick.substring(0, 25) @ "\n";
    
    temp.c = temp.score.tokenize();
    for (temp.i: temp.c) {
      temp.ind = c.index(i);
      
      temp.txt @= " " @ i @ ",";
      if (ind == 5) temp.txt @= "\n";
    }
    temp.txt = txt.substring(0, txt.length() - 1) @ "\n";
  }
  player.say2(temp.txt);
}
Reply With Quote
  #20  
Old 04-11-2009, 02:46 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Indeed, I am fairly certain it can be used serverside.
__________________
Reply With Quote
  #21  
Old 04-23-2009, 11:33 AM
Raelyn Raelyn is offline
the Professional.
Raelyn's Avatar
Join Date: Sep 2003
Location: Zormite
Posts: 964
Raelyn will become famous soon enough
Question #8

If I am going to be replacing the default tileset, how would I apply it online? Not really sure how to use addtiledef online.

The tiles has to be in levels\images\ also, right?
__________________
*Don't let the door hit you on the way out.*
Reply With Quote
  #22  
Old 04-23-2009, 12:21 PM
TSAdmin TSAdmin is offline
Forum Moderator
TSAdmin's Avatar
Join Date: Aug 2006
Location: Australia
Posts: 1,980
TSAdmin has much to be proud ofTSAdmin has much to be proud ofTSAdmin has much to be proud ofTSAdmin has much to be proud ofTSAdmin has much to be proud ofTSAdmin has much to be proud of
Quote:
Originally Posted by Raelyn View Post
If I am going to be replacing the default tileset, how would I apply it online? Not really sure how to use addtiledef online.

The tiles has to be in levels\images\ also, right?
If I'm not mistaken about your request, you want to make it a Weapon-NPC that adds to people as they log in. Within the Weapon-NPC, the following lines would be necessary to achieve the same output as if you were doing it offline in the Level Editor:

PHP Code:
//#CLIENTSIDE
function onCreated() {
  
removeTileDefs("");

  
addTileDef("tileImageFile.ext""prefix"type);

Yes, "tileImageFile.ext" must be in a valid image directory as defined in your Folder Options, generally in the folder you specified, or any custom sub-folder.
__________________
TSAdmin (Forum Moderator)
Welcome to the Official GraalOnline Forums! Where sharing an opinion may be seen as a declaration of war!
------------------------
· User Agreement · Code of Conduct · Forum Rules ·
· Graal Support · Administrative Contacts ·
Reply With Quote
  #23  
Old 04-23-2009, 09:50 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Adding a bit to what TSA said, you can also do stuff like

PHP Code:
addtiledef("tileset.png""server_"1);
addtiledef("cavetileset.png""servercave_"1); // or...
addtiledef("cavetileset.png""server_cave-"1); 
for adding custom tiles for certain levels, rather than putting it in the actual level.
__________________
Reply With Quote
  #24  
Old 04-24-2009, 12:04 AM
Raelyn Raelyn is offline
the Professional.
Raelyn's Avatar
Join Date: Sep 2003
Location: Zormite
Posts: 964
Raelyn will become famous soon enough
Quote:
Originally Posted by cbk1994 View Post
Adding a bit to what TSA said, you can also do stuff like

PHP Code:
addtiledef("tileset.png""server_"1);
addtiledef("cavetileset.png""servercave_"1); // or...
addtiledef("cavetileset.png""server_cave-"1); 
for adding custom tiles for certain levels, rather than putting it in the actual level.
Would I put this in a weapon and add to all players? Or would I put this in a global script, like NPC server?
__________________
*Don't let the door hit you on the way out.*
Reply With Quote
  #25  
Old 04-24-2009, 12:31 AM
Raelyn Raelyn is offline
the Professional.
Raelyn's Avatar
Join Date: Sep 2003
Location: Zormite
Posts: 964
Raelyn will become famous soon enough
Question #9

When adding gmaps online, if I am going to be placing additional gmaps, such as a 2 level gmap to make a larger room, etc, do I have to add a loadmap function for that? Or does the server automatically detect all the new gmaps?
__________________
*Don't let the door hit you on the way out.*
Reply With Quote
  #26  
Old 04-24-2009, 12:34 AM
Tigairius Tigairius is offline
The Cat
Tigairius's Avatar
Join Date: Jan 2007
Location: Missouri, USA
Posts: 4,240
Tigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant future
You need to use gmaps= in server options. It will automatically load the gmap if it is in that list. After you add it, type "/updatelevel whatever.gmap" in RC.

If the NPC-Server has rights to the gmap, you can also use the scripting function:
PHP Code:
addgmap(str) - adds dynamicly a gmap to the options and loads it 
__________________


“Shoot for the moon. Even if you miss, you'll land among the stars.”
Reply With Quote
  #27  
Old 04-24-2009, 01:10 AM
Raelyn Raelyn is offline
the Professional.
Raelyn's Avatar
Join Date: Sep 2003
Location: Zormite
Posts: 964
Raelyn will become famous soon enough
Quote:
Originally Posted by Tigairius View Post
You need to use gmaps= in server options. It will automatically load the gmap if it is in that list. After you add it, type "/updatelevel whatever.gmap" in RC.

If the NPC-Server has rights to the gmap, you can also use the scripting function:
PHP Code:
addgmap(str) - adds dynamicly a gmap to the options and loads it 
Would that be:


PHP Code:
gmaps=aetherforge_main.gmap
or

PHP Code:
gmaps=aetherfoge_main
?
__________________
*Don't let the door hit you on the way out.*
Reply With Quote
  #28  
Old 04-24-2009, 01:17 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by Raelyn View Post
Would that be:


PHP Code:
gmaps=aetherforge_main.gmap
or

PHP Code:
gmaps=aetherfoge_main
?
The second one.
__________________
Reply With Quote
  #29  
Old 04-24-2009, 01:31 AM
Raelyn Raelyn is offline
the Professional.
Raelyn's Avatar
Join Date: Sep 2003
Location: Zormite
Posts: 964
Raelyn will become famous soon enough
Quote:
Originally Posted by cbk1994 View Post
The second one.
Alright, thanks.
__________________
*Don't let the door hit you on the way out.*
Reply With Quote
  #30  
Old 04-24-2009, 01:55 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by Raelyn View Post
Would I put this in a weapon and add to all players? Or would I put this in a global script, like NPC server?
[sorry, didn't see this earlier]

It has to be in a weapon that all players have; addtiledef only works clientside. TSA provided a code example that you can pretty much copy and paste in.
__________________
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 03:08 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.