Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > New Scripting Engine (GS2)
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 07-28-2007, 02:50 AM
Cherrykao Cherrykao is offline
Banned
Join Date: Apr 2007
Posts: 37
Cherrykao is on a distinguished road
setting hat on a character in GS2

i know the GS1 command is "setcharprop #P1" for setting a hat on an NPC, but is there a GS2 command for setting a hat on a character or NPC like "headimg" for head, "bodyimg" for body, etc...

i also have another question. how or what function determines whether or not players are able to walk through another player and players cannot walk through other players? do people just script their own functions for this or is there a command that can be used?? thanks.
Reply With Quote
  #2  
Old 07-28-2007, 02:58 AM
coreys coreys is offline
N-Pulse Assistant Manager
coreys's Avatar
Join Date: Mar 2005
Posts: 2,180
coreys has a spectacular aura about
Send a message via AIM to coreys Send a message via MSN to coreys Send a message via Yahoo to coreys
player.attr[0] = "imagename";
I believe.
__________________

Quote:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
Reply With Quote
  #3  
Old 07-28-2007, 03:14 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Only way to make players walk through each other is to make the area a nopk zone. Though, someone recently posted a script in the code gallery that did that exact thing.
Reply With Quote
  #4  
Old 07-28-2007, 05:12 AM
Cherrykao Cherrykao is offline
Banned
Join Date: Apr 2007
Posts: 37
Cherrykao is on a distinguished road
thanks. i ran into another problem. here's what i did:

PHP Code:
function onPlayerEnters() {
  
datalog.loadvars("levels/datastuff.txt");

  
stat datalog.info;
}

//#CLIENTSIDE
function onCreated() {
  
this.chat format("This info: %s",stat);

when i run this script, the output is: "This info: 0". there's already stuff saved into this text file. datalog.info should contain a string: "test" and not the number 0. i can't seem to correctly copy variables from serverside to clientside (or vice versa).

i don't want to get rid of the CLIENTSIDE comment since i have additional functions below this that are clientside functions only.
Reply With Quote
  #5  
Old 07-28-2007, 05:21 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
You can't just read a serverside variable from the clientside. You should use attr's.
Reply With Quote
  #6  
Old 07-28-2007, 05:27 AM
Cherrykao Cherrykao is offline
Banned
Join Date: Apr 2007
Posts: 37
Cherrykao is on a distinguished road
thanks. it works using attr's.
Reply With Quote
  #7  
Old 07-28-2007, 11:27 AM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
Here's what I do

PHP Code:
if (player.chat.starts("sethat"))
  
player.attr[1] = player.chat.substring(7,-1); 
Reply With Quote
  #8  
Old 07-28-2007, 04:24 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
Quote:
Originally Posted by Twinny View Post
Here's what I do

PHP Code:
if (player.chat.starts("sethat"))
  
player.attr[1] = player.chat.substring(7,-1); 
pshaw. Thats noob code.

PHP Code:
tokens player.chat.tokenize();
if ( 
tokens[0] == "/sethat" )
{
  
player.attr[1] = tokens[1];

^-- That's where it's at.
__________________
Reply With Quote
  #9  
Old 07-28-2007, 04:42 PM
Rapidwolve Rapidwolve is offline
Registered User
Join Date: Jul 2006
Posts: 1,241
Rapidwolve is an unknown quantity at this point
Quote:
Originally Posted by cbkbud View Post
PHP Code:
tokens player.chat.tokenize();
if ( 
tokens[0] == "/sethat" )
{
  
player.attr[1] = tokens[1];

ew o-o
Reply With Quote
  #10  
Old 07-28-2007, 05:26 PM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
Quote:
Originally Posted by cbkbud View Post
pshaw. Thats noob code.

PHP Code:
tokens player.chat.tokenize();
if ( 
tokens[0] == "/sethat" )
{
  
player.attr[1] = tokens[1];

^-- That's where it's at.
That tokenize was seriously unnecessary... I didn't create a var (you also forgot to temp it) and I didn't need to tokenize it then access an index...
Reply With Quote
  #11  
Old 07-28-2007, 05:34 PM
coreys coreys is offline
N-Pulse Assistant Manager
coreys's Avatar
Join Date: Mar 2005
Posts: 2,180
coreys has a spectacular aura about
Send a message via AIM to coreys Send a message via MSN to coreys Send a message via Yahoo to coreys
I think that was the point...I think he was joking. lol
__________________

Quote:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
Reply With Quote
  #12  
Old 08-12-2007, 09:09 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 coreys View Post
I think that was the point...I think he was joking. lol
This forum has too many retards to try to guess which ones are actually average people making a joke, so I just lump them all in the retard box if they say crap like that.

PHP Code:
if (player.chat.starts("sethat "))
  
player.attr[1] = player.chat.substring(7,-1); 
Better like that, with the space at the end of sethat

So if I say "sethatfrootloopston" it wont do anything.
__________________
Reply With Quote
  #13  
Old 08-13-2007, 06:13 PM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
Quote:
Originally Posted by cbkbud View Post
pshaw. Thats noob code.

PHP Code:
tokens player.chat.tokenize();
if ( 
tokens[0] == "/sethat" )
{
  
player.attr[1] = tokens[1];

^-- That's where it's at.
Using tokenize without parameters is real noob code.
__________________
Do it with a DON!
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 06:18 PM.


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