Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 07-23-2002, 04:33 AM
darkriders_p2p darkriders_p2p is offline
Registered User
Join Date: Jan 2002
Location: Canada
Posts: 690
darkriders_p2p is on a distinguished road
Param Problem


Hey, i got this problem with params when using tokenize, could someone explain why these params are read as 0?

NPC Code:

//from another part of the script:
setstring server.hammerresources,sand,0,wood,25,ore,15;
setstring client.makeweapon,hammer;
tokenize #s(server.#s(client.makeweapon)resources);
//end
if (strtofloat(#t(3))>0){
this.recsneeded++;
if (strtofloat(#s(client.wood))>=strtofloat(#p(3))){
this.ok++;
setstring client.wood,#v(strtofloat(#s(client.wood))-strtofloat(#p(3)));
}else setplayerprop #c,You dont have enough recourses!;
}
if (strtofloat(#t(5))>0){
this.recsneeded++;
if (strtofloat(#s(client.ore))>=strtofloat(#p(5))){
this.ok++;
setstring client.ore,#v(strtofloat(#p(5)));
}else setplayerprop #c,You dont have enough recourses!;
}

__________________
maximus_asinus

Last edited by darkriders_p2p; 07-23-2002 at 07:04 PM..
Reply With Quote
  #2  
Old 07-23-2002, 08:51 PM
darkriders_p2p darkriders_p2p is offline
Registered User
Join Date: Jan 2002
Location: Canada
Posts: 690
darkriders_p2p is on a distinguished road

yea, that would probably be smarter...
sometimes Im a bit dumb

One thing though, i didn't find any answer to this in newfeatures2001.txt so;
How do i set a stringarray with all its values in one command, like with normal arrays: array={1,2,3,7};
Is it possible? or do i have to type in a bunch of addstring commands?
__________________
maximus_asinus

Last edited by darkriders_p2p; 07-23-2002 at 09:20 PM..
Reply With Quote
  #3  
Old 07-23-2002, 09:58 PM
screen_name screen_name is offline
is watching you
Join Date: Mar 2002
Location: The 3rd Dimension
Posts: 2,160
screen_name is on a distinguished road
Send a message via AIM to screen_name Send a message via MSN to screen_name
setstring name,stuff,bla,blue,niceguy;

you read from the array like this

NPC Code:

#I(arrayname,index);



remember, indexes start with 0
so #I(arrayname,0) would be 'stuff'
__________________
[signature]insert here[/signature]
Reply With Quote
  #4  
Old 07-23-2002, 10:09 PM
darkriders_p2p darkriders_p2p is offline
Registered User
Join Date: Jan 2002
Location: Canada
Posts: 690
darkriders_p2p is on a distinguished road

yea i know that, i just thought it should be like
setstring strarray,"1""45""text";
but i was wrong, again...
__________________
maximus_asinus
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 12:17 PM.


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