Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 06-21-2006, 12:25 PM
Omini Omini is offline
Millenium Owner
Join Date: Feb 2006
Location: N.Ireland
Posts: 293
Omini is on a distinguished road
Send a message via AIM to Omini Send a message via MSN to Omini Send a message via Yahoo to Omini
Server flags

How am I meant to do something like this in GS2

PHP Code:
if (actionserverside) {
  if (
strequals(#p(0),takepoint)) {
    
replacestring serverr.zone#p(1),1,#v(strtofloat(#I(serverr.zone#p(1),1))-(1/120));
    
if (strtofloat(#I(serverr.zone#p(1),1))<=0) setstring serverr.zone#p(1),#g,0;
  
}
  if (
strequals(#p(0),addpoint)) {
    
replacestring serverr.zone#p(1),1,#v(strtofloat(#I(serverr.zone#p(1),1))+(.5/120));
    
if (strtofloat(#I(serverr.zone#p(1),1))>=100) replacestring serverr.zone#p(1),1,100;
  
}
}
//#CLIENTSIDE
if (created||timeout) {
if (
isonmap) {
  
showpoly 4000,{screenwidth-100,0,screenwidth,0,screenwidth,40,screenwidth-100,40};
  
changeimgvis 4000,4;
  if (
strequals(#g,)||!strcontains(#s(serverr.gangtags),#g)) changeimgcolors 4000,0,0,0,1;
  
elseif (strequals(#I(serverr.zone#v(int(playerx/((64*20)/5)))-#v(int(playery/((64*20)/5))),0),#g)) changeimgcolors 4000,0,1,0,1;
  
else changeimgcolors 4000,1,0,0,1;
  
showtext 5000,screenwidth-95,5,Arial,b,Owner#I(serverr.zone#v(int(playerx/((64*20)/5)))-#v(int(playery/((64*20)/5))),0);
  
changeimgzoom 5000,.5;changeimgvis 5000,5;changeimgcolors 5000,1,1,1,1;
  
showtext 5001,screenwidth-95,15,Arial,b,Points#v(int(strtofloat(#I(serverr.zone#v(int(playerx/((64*20)/5)))-#v(int(playery/((64*20)/5))),1))));
  
changeimgzoom 5001,.5;changeimgvis 5001,5;changeimgcolors 5001,1,1,1,1;
  }
  else 
hideimgs 4000,5001;
  if (
strcontains(#s(serverr.gangtags),#g)) {
    
if (isonmap) {
      
this.time+=.1;
      if (
this.time>=.5) {
        if (!
strequals(#I(serverr.zone#v(int(playerx/((64*20)/5)))-#v(int(playery/((64*20)/5))),0),#g)) triggeraction 0,0,serverside,-Systems/GangPoints,takepoint,#v(int(playerx/((64*20)/5)))-#v(int(playery/((64*20)/5)));
        
else triggeraction 0,0,serverside,-Systems/GangPoints,addpoint,#v(int(playerx/((64*20)/5)))-#v(int(playery/((64*20)/5)));
        
this.time=0;
      }
    } else 
this.time=0;
  }else 
this.time=0;
  
timeout=.1;

I don't know how I'm meant to get a retrived part of the string into it. I tried

PHP Code:
"Owner: "@serverr.zone@thiso.playerzonex@-@thiso.playerzoney@@; 
with
thiso.playerzonex = int(playerx/((64*20)/5));
thiso.playerzoney = int(playery/((64*20)/5));

Earlier in the script.

How do I do that in GS2?
__________________



Reply With Quote
  #2  
Old 06-21-2006, 02:03 PM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
This is where you use either makevar, or some weird use of the concatination operator and a few brackets.

makevar("serverr.zone" @ thiso.playerzonex - thiso.playerzoney);
serverr.("zone" @ thiso.playerzonex - thiso.playerzoney);

The latter is generally more approved by Stefan and most of the scripting community, I think it looks kind of odd though
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #3  
Old 06-22-2006, 12:07 PM
Omini Omini is offline
Millenium Owner
Join Date: Feb 2006
Location: N.Ireland
Posts: 293
Omini is on a distinguished road
Send a message via AIM to Omini Send a message via MSN to Omini Send a message via Yahoo to Omini
But the serverr string is something like
serverr.zone4-4

It doesn't take away thiso.playerzoney from thiso.playerzonex, so would that make it

serverr.("zone" @ thiso.playerzonex @ "-" @ thiso.playerzoney);
__________________



Reply With Quote
  #4  
Old 06-22-2006, 05:08 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Yes.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #5  
Old 06-22-2006, 06:36 PM
Omini Omini is offline
Millenium Owner
Join Date: Feb 2006
Location: N.Ireland
Posts: 293
Omini is on a distinguished road
Send a message via AIM to Omini Send a message via MSN to Omini Send a message via Yahoo to Omini
Thanks for your help =)
__________________



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 05:18 PM.


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