Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 03-18-2007, 01:46 AM
theHAWKER theHAWKER is offline
**FLIP OUT**
theHAWKER's Avatar
Join Date: Mar 2006
Location: canada, vancouver
Posts: 768
theHAWKER is an unknown quantity at this point
Cool Teams?

In an event i want to sort people into teams, but i don't even know how to start the script x.x this is how far i got:
PHP Code:
if (playerchats){
if (
startswith(#g,Events Team)){
if (strequals(#c,/teams)){
}
}

could somone get me started plz?
__________________
**FLIP OUT**
Reply With Quote
  #2  
Old 03-18-2007, 02:02 AM
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 theHAWKER View Post
In an event i want to sort people into teams, but i don't even know how to start the script x.x this is how far i got:
PHP Code:
if (playerchats){
if (
startswith(#g,Events Team)){
if (strequals(#c,/teams)){
}
}

could somone get me started plz?
Sure.
PHP Code:
function onPlayerChats()
{
  if ( 
player.guild.starts"Events Team" )
  {
     if ( 
player.chat == "/teams" )
     {
        
sortPlayersIntoTeams();
     }
  }

There you go
__________________
Reply With Quote
  #3  
Old 03-18-2007, 02:09 AM
godofwarares godofwarares is offline
Webmaster
godofwarares's Avatar
Join Date: Dec 2006
Location: Florida
Posts: 552
godofwarares is on a distinguished road
Send a message via ICQ to godofwarares Send a message via AIM to godofwarares Send a message via MSN to godofwarares Send a message via Yahoo to godofwarares
Quote:
Originally Posted by cbkbud View Post
Sure.
PHP Code:
function onPlayerChats()
{
  if ( 
player.guild.starts"Events Team" )
  {
     if ( 
player.chat == "/teams" )
     {
        
sortPlayersIntoTeams();
     }
  }

There you go
Thats not what he meant, Nor did he want it in GS2.


I'd suggest you use a loop through all the players in the level, similar to:
PHP Code:
for (0playerscounti++)
{
     
with (players[i])
     {
          if (!(
i%2)) // Team 1
          
{
               
setstring this.team,"Red";
          } else { 
// Team 2
               
setstring this.team,"Blue";
          }
     }

__________________
What signature? I see no signature?

Last edited by godofwarares; 03-18-2007 at 02:24 AM..
Reply With Quote
  #4  
Old 03-18-2007, 02:14 AM
killerogue killerogue is offline
Registered Omega
killerogue's Avatar
Join Date: Apr 2006
Location: United States
Posts: 1,920
killerogue is on a distinguished road
Send a message via AIM to killerogue Send a message via MSN to killerogue
Quote:
Originally Posted by theHAWKER View Post
In an event i want to sort people into teams, but i don't even know how to start the script x.x this is how far i got:
PHP Code:
if (playerchats){
if (
startswith(#g,Events Team)){
if (strequals(#c,/teams)){
}
}

could somone get me started plz?

EEW GS1!!! Dude, Gs2 is better than GS1, on top of that it's easier to use and is object based making things 1 thousand times easier in my opinion. :o
__________________


REMEMBER, IF YOU REP ME, LEAVE A NAME!

Quote:
Originally Posted by haunter View Post
Graal admins don't die. They go to hell and regroup.
Quote:
Originally Posted by Inverness View Post
Without scripters, your graphics and levels wouldn't do anything but sit there and look pretty.
Reply With Quote
  #5  
Old 03-18-2007, 02:14 AM
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
I'll make one for you, is GS2 okay? There's no way I'm going to script in GS1
__________________
Reply With Quote
  #6  
Old 03-18-2007, 02:16 AM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Well I would set a guild tag right away ;o

PHP Code:
for (0playerscounti++) {
  
with (players[i]) {
    if (!(
i%2)) // Team 1
      
player.guild "Team Red";
    else 
// Team 2
      
player.guild "Team Blue";
    }
  }

Reply With Quote
  #7  
Old 03-18-2007, 02:19 AM
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 killerogue View Post
EEW GS1!!! Dude, Gs2 is better than GS1, on top of that it's easier to use and is object based making things 1 thousand times easier in my opinion. :o
I second that.

As I've always said, compare these ...

GS1
PHP Code:
setstring serverr.blah,strtofloat(#s(serverr.blah))+strtofloat(#t(1)); 
vs.

GS2
PHP Code:
serverr.blah += tokens[1]; 
You decide
__________________
Reply With Quote
  #8  
Old 03-18-2007, 02:22 AM
godofwarares godofwarares is offline
Webmaster
godofwarares's Avatar
Join Date: Dec 2006
Location: Florida
Posts: 552
godofwarares is on a distinguished road
Send a message via ICQ to godofwarares Send a message via AIM to godofwarares Send a message via MSN to godofwarares Send a message via Yahoo to godofwarares
Who cares if its GS1!
Apparently he's making it in GraalEditor (I'm not sure though), so cut him some slack. He may just be learning -_-


But I agree -- GS2 > GS1.


-Edit: Stan, I believe the phrase you're looking for is "Object Oriented Programming".
__________________
What signature? I see no signature?
Reply With Quote
  #9  
Old 03-18-2007, 02:34 AM
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 godofwarares View Post
Who cares if its GS1!
Apparently he's making it in GraalEditor (I'm not sure though), so cut him some slack. He may just be learning -_-


But I agree -- GS2 > GS1.


-Edit: Stan, I believe the phrase you're looking for is "Object Oriented Programming".
No one is yelling at him. I'm simply refusing to script in GS1. I hate it. It gives me headaches
__________________
Reply With Quote
  #10  
Old 03-18-2007, 02:38 AM
killerogue killerogue is offline
Registered Omega
killerogue's Avatar
Join Date: Apr 2006
Location: United States
Posts: 1,920
killerogue is on a distinguished road
Send a message via AIM to killerogue Send a message via MSN to killerogue
Quote:
Originally Posted by godofwarares View Post
-Edit: Stan, I believe the phrase you're looking for is "Object Oriented Programming".
It's really all the same meaning.
__________________


REMEMBER, IF YOU REP ME, LEAVE A NAME!

Quote:
Originally Posted by haunter View Post
Graal admins don't die. They go to hell and regroup.
Quote:
Originally Posted by Inverness View Post
Without scripters, your graphics and levels wouldn't do anything but sit there and look pretty.
Reply With Quote
  #11  
Old 03-18-2007, 02:59 AM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Quote:
Originally Posted by cbkbud View Post
No one is yelling at him. I'm simply refusing to script in GS1. I hate it. It gives me headaches
Which is proving that you dont really understand it. Pwnt.
Reply With Quote
  #12  
Old 03-18-2007, 03:27 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 cbkbud View Post
GS1
PHP Code:
setstring serverr.blah,strtofloat(#s(serverr.blah))+strtofloat(#t(1)); 
PHP Code:
setstring serverr.blah,#v(strtofloat(#s(serverr.blah))+strtofloat(#t(1))); 
__________________
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 03-18-2007, 02:16 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
Okay, I can't see any reason why you would make this on the editor, since you are the only player, and as far as I remember 'with' functions require an NPC-Server. If you are making it online, there's no reason why GS2 shouldn't work.
__________________
Reply With Quote
  #14  
Old 03-18-2007, 02:59 PM
godofwarares godofwarares is offline
Webmaster
godofwarares's Avatar
Join Date: Dec 2006
Location: Florida
Posts: 552
godofwarares is on a distinguished road
Send a message via ICQ to godofwarares Send a message via AIM to godofwarares Send a message via MSN to godofwarares Send a message via Yahoo to godofwarares
Quote:
Originally Posted by cbkbud View Post
Okay, I can't see any reason why you would make this on the editor, since you are the only player, and as far as I remember 'with' functions require an NPC-Server. If you are making it online, there's no reason why GS2 shouldn't work.
Could be Unholy Nation
__________________
What signature? I see no signature?
Reply With Quote
  #15  
Old 03-19-2007, 04:19 AM
theHAWKER theHAWKER is offline
**FLIP OUT**
theHAWKER's Avatar
Join Date: Mar 2006
Location: canada, vancouver
Posts: 768
theHAWKER is an unknown quantity at this point
T.T im using this for a server, i dont know how to know GS2 cause theres no tutorial or anything.... and i just want a team sorter plz?
__________________
**FLIP OUT**
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 09:37 PM.


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