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 02-12-2006, 10:57 PM
projectigi projectigi is offline
Registered User
Join Date: Jan 2004
Posts: 403
projectigi is an unknown quantity at this point
Strings, Arrays and Problems..

Hi,

so i got a DB NPC set flags to
NPC Code:

rights_projectigi={1,1,0,1,1};


then i used
req_player is a player object
reqq_player is set to projectigi
means reqq_player="projectigi";
NPC Code:

with(findnpc("Foobar")){
req_player.clientr.loadrights = this.("rights_"@reqq_player);
}



so when i try to do player.chat=clientr.loadrights[0];
on clientside then my player says {1

thats the problem i need him to see it as 1
so the first thing of an array
but i cant just get the {} away because then when i send an array like this blah={1,1,0,1}; it woudl be blah=1,1,0,1; and that would mess up the triggeractions param order
Reply With Quote
  #2  
Old 02-12-2006, 11:02 PM
ZeLpH_MyStiK ZeLpH_MyStiK is offline
Scripter
ZeLpH_MyStiK's Avatar
Join Date: May 2003
Location: NYC
Posts: 553
ZeLpH_MyStiK is on a distinguished road
Send a message via MSN to ZeLpH_MyStiK Send a message via Yahoo to ZeLpH_MyStiK
array = {1,2,2390};
array[0] == 1
array[1] == 2
array[3] == 2390
Or if you want to use a string list, use quotes
__________________
Reply With Quote
  #3  
Old 02-12-2006, 11:28 PM
projectigi projectigi is offline
Registered User
Join Date: Jan 2004
Posts: 403
projectigi is an unknown quantity at this point
well they should be booleans
and as i posted i set it like this
rights_projectigi={1,1,0,1,1};

then gave it with this to clientside



with(findnpc("Foobar")){

req_player.clientr.loadrights = this.("rights_"@reqq_player);

}

but on clientside player.chat=clientr.loadrights[0];
it says {1
Reply With Quote
  #4  
Old 02-12-2006, 11:34 PM
Rick Rick is offline
PipBoy Extraordinaire!
Rick's Avatar
Join Date: Jul 2004
Location: Long Beach, California.
Posts: 831
Rick is on a distinguished road
this.(@"rights_" @ reqq_player)
Reply With Quote
  #5  
Old 02-12-2006, 11:37 PM
projectigi projectigi is offline
Registered User
Join Date: Jan 2004
Posts: 403
projectigi is an unknown quantity at this point
still {1
clientr.loadrights={1,1,1,1,1} <- from /open projectigi
Reply With Quote
  #6  
Old 02-12-2006, 11:45 PM
Rick Rick is offline
PipBoy Extraordinaire!
Rick's Avatar
Join Date: Jul 2004
Location: Long Beach, California.
Posts: 831
Rick is on a distinguished road
Is your client Graal2?
Reply With Quote
  #7  
Old 02-12-2006, 11:57 PM
projectigi projectigi is offline
Registered User
Join Date: Jan 2004
Posts: 403
projectigi is an unknown quantity at this point
no its V4
Reply With Quote
  #8  
Old 02-12-2006, 11:59 PM
Riot Riot is offline
Delteria Management
Join Date: Nov 2003
Location: Seminole County, Florida
Posts: 280
Riot is on a distinguished road
If I remember correctly, you have to use the old format for arrays when you're dealing with flags in DB-NPCs and Player Attributes (if editing from RC/NC). By the looks of it you're trying to use the new format.
Reply With Quote
  #9  
Old 02-13-2006, 12:01 AM
projectigi projectigi is offline
Registered User
Join Date: Jan 2004
Posts: 403
projectigi is an unknown quantity at this point
old format? new format? huh?
Reply With Quote
  #10  
Old 02-13-2006, 12:10 AM
Riot Riot is offline
Delteria Management
Join Date: Nov 2003
Location: Seminole County, Florida
Posts: 280
Riot is on a distinguished road
1,1,1,1,1 instead of {1,1,1,1,1}
Reply With Quote
  #11  
Old 02-13-2006, 06:54 AM
ZeLpH_MyStiK ZeLpH_MyStiK is offline
Scripter
ZeLpH_MyStiK's Avatar
Join Date: May 2003
Location: NYC
Posts: 553
ZeLpH_MyStiK is on a distinguished road
Send a message via MSN to ZeLpH_MyStiK Send a message via Yahoo to ZeLpH_MyStiK
Quote:
Originally Posted by Riot
1,1,1,1,1 instead of {1,1,1,1,1}
Wth?
1,1,1,1,1 is a string array, while
{1,1,1,1,1} is an array.
__________________
Reply With Quote
  #12  
Old 02-13-2006, 06:56 AM
napo_p2p napo_p2p is offline
oh snaps
napo_p2p's Avatar
Join Date: Sep 2003
Location: Pismo Beach, California
Posts: 2,118
napo_p2p has a spectacular aura aboutnapo_p2p has a spectacular aura about
Send a message via AIM to napo_p2p Send a message via MSN to napo_p2p
Quote:
Originally Posted by ZeLpH_MyStiK
Wth?
1,1,1,1,1 is a string array, while
{1,1,1,1,1} is an array.
If you look at the flags in a database NPC, they are like:
1,1,1,1,1

and not:
{1,1,1,1,1}


Don't ask me why. It just is .
__________________
Scito hoc super omnia.
Haec vita est tua una sola.
Dum vita superest, utere maxime quoque puncto, momento, et hora quae habes.
Tempus neminem non manet.
Noli manere tempus.
Carpe Diem

Seize the Day.
Reply With Quote
  #13  
Old 02-13-2006, 06:57 AM
ZeLpH_MyStiK ZeLpH_MyStiK is offline
Scripter
ZeLpH_MyStiK's Avatar
Join Date: May 2003
Location: NYC
Posts: 553
ZeLpH_MyStiK is on a distinguished road
Send a message via MSN to ZeLpH_MyStiK Send a message via Yahoo to ZeLpH_MyStiK
Quote:
Originally Posted by napo_p2p
If you look at the flags in a database NPC, they are like:
1,1,1,1,1

and not:
{1,1,1,1,1}


Don't ask me why. It just is .
Oh, I thought he meant setting them.

Edit: Wait a minute...It doesn't matter how it looks, since you can't set the way it shows up in the flags of dbnpcs.
__________________
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:51 AM.


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