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
  #1  
Old 08-31-2005, 02:01 AM
excaliber7388 excaliber7388 is offline
Banned
excaliber7388's Avatar
Join Date: Jul 2005
Location: US
Posts: 5,229
excaliber7388 can only hope to improve
Send a message via AIM to excaliber7388
scripting trouble -.-

Whats wrong with this script? It works fine offline. It should play a song thats in your graal folder, so people can use it like an MP3 player

NPC Code:
//#CLIENTSIDE
if(playerchats&&startswith(/play,#c)){
setstring clientr.song,#T(#e(5,-1,#c));
play #s(clientr.song)
}

Reply With Quote
  #2  
Old 08-31-2005, 02:06 AM
Torankusu_2002 Torankusu_2002 is offline
'been round.
Torankusu_2002's Avatar
Join Date: Nov 2001
Posts: 1,246
Torankusu_2002 is on a distinguished road
clientr. strings can only be changed serverside, read clientside.

You would have to use regular client. strings, or access it serverside.

My suggestion is that in the future, if you are trying to script simple things and use client strings, use regular client.strings. However, if you're going for things you don't want to be changed by 3rd party programs (hex editors, or whatever,) then I suggest using clientr.strings. Example: clientr.rupees, clientr.fullhearts, or something of the sort. Get it?
__________________
torankusu's
Reply With Quote
  #3  
Old 08-31-2005, 02:13 AM
Maniaman Maniaman is offline
Registered User
Join Date: Aug 2005
Posts: 326
Maniaman is on a distinguished road
Why the #T()?
__________________

Current Maloria Event: (click to go to it)
Reply With Quote
  #4  
Old 08-31-2005, 02:16 AM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
Quote:
Originally Posted by Maniaman
Why the #T()?
It trims whitespace. So he could say, for example, '/playfilename' or '/play filename'.
Reply With Quote
  #5  
Old 08-31-2005, 02:16 AM
Torankusu_2002 Torankusu_2002 is offline
'been round.
Torankusu_2002's Avatar
Join Date: Nov 2001
Posts: 1,246
Torankusu_2002 is on a distinguished road
Quote:
Originally Posted by Maniaman
Why the #T()?
trims the space.
basically what lance said, i just took to long.

--edited.
__________________
torankusu's
Reply With Quote
  #6  
Old 08-31-2005, 02:18 AM
Maniaman Maniaman is offline
Registered User
Join Date: Aug 2005
Posts: 326
Maniaman is on a distinguished road
Ah, ok.
__________________

Current Maloria Event: (click to go to it)
Reply With Quote
  #7  
Old 08-31-2005, 02:20 AM
Bl0nkt Bl0nkt is offline
Era Developer
Bl0nkt's Avatar
Join Date: Mar 2005
Location: Pennsylvania
Posts: 1,589
Bl0nkt will become famous soon enough
Send a message via AIM to Bl0nkt
NPC Code:
if (actionserverside) { 
if (strequals(#p(0),playsong)) {
setstring clientr.song,strtofloat(#p(1));
play #s(clientr.song);
}
}

//#CLIENTSIDE
if (playerchats && startswith(/play,#c) && tokenscount == 2) {
tokenize #c;
triggeraction 0,0,serverside,playsong,#t(1);
}



I believe this is right.
Reply With Quote
  #8  
Old 08-31-2005, 02:26 AM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
Quote:
Originally Posted by Bl0nkt
NPC Code:
if (actionserverside) { 
if (strequals(#p(0),playsong)) {
setstring clientr.song,strtofloat(#p(1));
play #s(clientr.song);
}
}

//#CLIENTSIDE
if (playerchats && startswith(/play,#c) && tokenscount == 2) {
tokenize #c;
triggeraction 0,0,serverside,playsong,#t(1);
}



I believe this is right.
No. You cannot use the play command serverside.
Reply With Quote
  #9  
Old 08-31-2005, 02:40 AM
excaliber7388 excaliber7388 is offline
Banned
excaliber7388's Avatar
Join Date: Jul 2005
Location: US
Posts: 5,229
excaliber7388 can only hope to improve
Send a message via AIM to excaliber7388
it works now i made it client.song instead of clientr.song thx!
Reply With Quote
  #10  
Old 08-31-2005, 02:44 AM
Torankusu_2002 Torankusu_2002 is offline
'been round.
Torankusu_2002's Avatar
Join Date: Nov 2001
Posts: 1,246
Torankusu_2002 is on a distinguished road
Quote:
Originally Posted by excaliber7388
it works now i made it client.song instead of clientr.song thx!
no problem.
just keep in mind what i said.
__________________
torankusu's
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:14 PM.


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