Poll

Do we need a client-side scripting system?

Yes
17 (68%)
No
8 (32%)

Total Members Voted: 21

Voting closed: February 15, 2007, 04:39:04 pm

Author Topic: Client-side Scripting  (Read 15978 times)

daenyth

  • Posts: 230
  • Turrets: +21/-26
Client-side Scripting
« on: February 15, 2007, 04:39:04 pm »
With all the recent talks of a client-side scripting system, (just simple conditionals and variables, $currentstage$, $tonextstage$, $currentweapon$, etc.) I was wondering if anyone wanted to take up this project? I'd love to, but I just don't have the knowledge needed to do it. I'll be happy to beta-test though.
Quote from: Bullislander05
It's like trying to take apple seeds out of a zebra to plant a giraffe tree.

Odin

  • Spam Killer
  • *
  • Posts: 1767
  • Turrets: +113/-204
    • My Website
Client-side Scripting
« Reply #1 on: February 15, 2007, 06:38:10 pm »
Shouldn't it rather be a server-side scripting system? Client-side would only make things bad.

techhead

  • Posts: 1496
  • Turrets: +77/-73
    • My (Virtually) Infinite Source of Knowledge (and Trivia)
Client-side Scripting
« Reply #2 on: February 15, 2007, 08:20:42 pm »
Why not have client-side?
A "Ovemind/Reactor down, Defend!!" bind would be better if it knew which team you were on, without having to go through scripting with separate bind lists.
I'm playing Tremulous on a Mac!
MGDev fan-club member
Techhead||TH
/"/""\"\
\"\""/"/
\\:.V.://
Copy and paste Granger into your signature!

daenyth

  • Posts: 230
  • Turrets: +21/-26
Client-side Scripting
« Reply #3 on: February 15, 2007, 08:55:49 pm »
Quote from: "Odin"
Shouldn't it rather be a server-side scripting system? Client-side would only make things bad.


I really don't see how this could be abused. Just things to allow stuff like "say_team $tonextstage$ kills to next stage!" or "if ($team$ == human) { class ckit } elseif ($team$ == alien) { class builder } else { echo "Join a team first!" }
Quote from: Bullislander05
It's like trying to take apple seeds out of a zebra to plant a giraffe tree.

daenyth

  • Posts: 230
  • Turrets: +21/-26
Client-side Scripting
« Reply #4 on: February 15, 2007, 09:05:31 pm »
Rather than arguing that it can be abused, why don't we agree upon what is needed by a simple script system?
IMO, these first two are most important; the variables would only be information to which the player already has access (mostly through the scoreboard splash, or the HUD). The conditionals are probably slightly less important.

Conditionals
if
elseif
else

Dynamic variables
$team$ (Which race am i?)
$stage$ (What stage is my team?)
$weapon$ ($class$?) (What weapon do I have?)
$tonextstage$ (How many kills to next stage?)
$location$ (Where in the map am I?)
$hp$ (My current hp)
$ammo$ (includes goon barbs)

Ability to create named functions
func &foo& { say_team "bar"; }


What NOT to implement?
for (spam concerns)
while (spam)
goto (spam)
What else?
Quote from: Bullislander05
It's like trying to take apple seeds out of a zebra to plant a giraffe tree.

David

  • Spam Killer
  • *
  • Posts: 3543
  • Turrets: +249/-273
Client-side Scripting
« Reply #5 on: February 15, 2007, 10:11:25 pm »
Functions = Spam too.

But I can do that already, with a cfg that exec's its self, or a vstr that calls its self.

all we need is the variable's (both in human readable and number form*) and a simple if system.
Everything else is already there,

*eg:
$team = Alien or Human or Spectator
#team = 0 or 1 or 2
Any maps not in the MG repo?  Email me or come to irc.freenode.net/#mg.
--
My words are mine and mine alone.  I can't speak for anyone else, and there is no one who can speak for me.  If I ever make a post that gives the opinions or positions of other users or groups, then they will be clearly labeled as such.
I'm disappointed that people's past actions have forced me to state what should be obvious.
I am not a dev.  Nothing I say counts for anything.

Stof

  • Posts: 1343
  • Turrets: +1/-1
Client-side Scripting
« Reply #6 on: February 15, 2007, 11:32:24 pm »
Quote from: "daenyth"
What NOT to implement?
for (spam concerns)
while (spam)
goto (spam)
What else?

Some corrections in what NOT to implement;
goto (goto)
; (spam)
functions (spam)
Code: [Select]
Examples:
func spam()
{
   say "SPAM";
   say "SPAM";
   say "SPAM";
   say "SPAM";
   say "SPAM";
   say "SPAM";
   say "SPAM";
   say "SPAM";
   say "SPAM";
   say "SPAM";
}

Example 2:
fun super_spam()
{
    spam();
    spam();
    spam();
    spam();
    spam();
    spam();
    spam();
    spam();
    spam();
    spam();
    spam();
}

Examples 3:
func monster_spam()
{
    super_spam();
    super_spam();
    super_spam();
    super_spam();
    super_spam();
    super_spam();
    super_spam();
    super_spam();
    super_spam();
}

Example 4:
func infinite_spam()
{
    monster_spam();
    infinite_spam();
}



Morailty, if spam is your concern, you might as well forget the whole scripting language thing or instead code spam limiters in the server.
urphy's rules of combat
8 ) Teamwork is essential; it gives the enemy someone else to shoot at.
18 ) Make it too tough for the enemy to get in and you can't get out.

whitebear

  • Posts: 659
  • Turrets: +35/-20
Client-side Scripting
« Reply #7 on: February 15, 2007, 11:35:08 pm »
I think these bind helpers are useless. Team say binds are useless too. I've started automaticly ignore all chat messages with anoying color coding. Ents in LoD movies are exactly correct that you should think if it's worth of teling before you say anything.

Every message that is binded start to look dull in it's repeativeness while people change what they say if it's done manualy every time.

David

  • Spam Killer
  • *
  • Posts: 3543
  • Turrets: +249/-273
Client-side Scripting
« Reply #8 on: February 16, 2007, 12:00:30 am »
All you need is:
Code: [Select]
set spam="say SPAM!;vstr spam"
vstr spam
Any maps not in the MG repo?  Email me or come to irc.freenode.net/#mg.
--
My words are mine and mine alone.  I can't speak for anyone else, and there is no one who can speak for me.  If I ever make a post that gives the opinions or positions of other users or groups, then they will be clearly labeled as such.
I'm disappointed that people's past actions have forced me to state what should be obvious.
I am not a dev.  Nothing I say counts for anything.

Coca-Cola

  • Posts: 122
  • Turrets: +1/-1
Client-side Scripting
« Reply #9 on: February 16, 2007, 01:36:18 am »
Code: [Select]

for(int i=1; i>0; i++){

say("My code>Yours");
}


pwnt ;p
f the brain was simple to understand, we'd be too simple to understand it.

Quote from: "Caveman"
Nothing can be made idiot-prove ...

Undeference

  • Tremulous Developers
  • *
  • Posts: 1254
  • Turrets: +122/-45
Client-side Scripting
« Reply #10 on: February 16, 2007, 04:58:59 am »
Surprise us. Write an interpreter (or better yet, a compiler, and use the existing vm to run the code) that supports what is currently available (server.cfg and maprotation.cfg should be directly supported) and submit your patch to Bugzilla. It should be usable enough to use custom g_admin commands. In fact, most of the hard coded g_admin commands could be reimplemented as custom commands if there were good enough scripting.
Of course, why it most likely won't make it for the client has already been discussed.
Need help? Ask intelligently. Please share solutions you find.

Thats what we need, helpful players, not more powerful admins.

Risujin

  • Posts: 739
  • Turrets: +33/-13
    • http://risujin.org
Client-side Scripting
« Reply #11 on: February 16, 2007, 05:58:02 am »
Code: [Select]
(loop for i across #(1 2 3) do (ap ("print \"omg its 1958 all over again\n\"")))

DASPRiD

  • Administrator
  • Posts: 549
  • Turrets: +21/-2
    • http://www.dasprids.de
Client-side Scripting
« Reply #12 on: February 16, 2007, 08:30:27 am »
Quote from: "techhead"
Why not have client-side?
A "Ovemind/Reactor down, Defend!!" bind would be better if it knew which team you were on, without having to go through scripting with separate bind lists.


Things Like Overmind down / Reactor down will be implemented with the radio commands in the next version. No need for senseless scripting. But we need scripting on the mapping-side.
url=https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=mail%40dasprids%2ede&item_name=DASPRiD%27s&no_shipping=0&no_note=1&tax=0&currency_code=EUR&lc=DE&bn=PP%2dDonationsBF&charset=UTF%2d8][/url]

techhead

  • Posts: 1496
  • Turrets: +77/-73
    • My (Virtually) Infinite Source of Knowledge (and Trivia)
Client-side Scripting
« Reply #13 on: February 16, 2007, 10:12:21 pm »
I was using it as an easy to cite example, scripting would also allow for some more complicated pre-programmed stuff.
I'm playing Tremulous on a Mac!
MGDev fan-club member
Techhead||TH
/"/""\"\
\"\""/"/
\\:.V.://
Copy and paste Granger into your signature!

Paradox

  • Posts: 2612
  • Turrets: +253/-250
    • Paradox Designs
Client-side Scripting
« Reply #14 on: February 17, 2007, 01:23:00 am »
One thing that is being mentioned is conditionals, if, else, etc. Loops would be great, for example:
Code: [Select]
//Script for building 5 acid tubes
var acidtube == 0
if acidtube > 5, then
for acictube 1
build acidtube
else
stop
As you can tell, i like RPN (dont ask what it is, you should know this).

∧OMG ENTROPY∧

daenyth

  • Posts: 230
  • Turrets: +21/-26
Client-side Scripting
« Reply #15 on: February 19, 2007, 02:12:57 am »
Quote from: "Undeference"
Surprise us. Write an interpreter (or better yet, a compiler, and use the existing vm to run the code) that supports what is currently available (server.cfg and maprotation.cfg should be directly supported) and submit your patch to Bugzilla. It should be usable enough to use custom g_admin commands. In fact, most of the hard coded g_admin commands could be reimplemented as custom commands if there were good enough scripting.
Of course, why it most likely won't make it for the client has already been discussed.


As I said, I simply don't have the required skill to do it myself... I thought I'd throw the idea out there and see what the community liked, but it seems that most people feel it's not needed.


And as for the spam concerns, I was a little short-sighted in saying which things may be bad to implement. After thinking about it some more if anyone did implement this, it would be better to include those functions (except goto :P), and just have server-side flood control, as some qvm's already do.
Quote from: Bullislander05
It's like trying to take apple seeds out of a zebra to plant a giraffe tree.

David

  • Spam Killer
  • *
  • Posts: 3543
  • Turrets: +249/-273
Client-side Scripting
« Reply #16 on: February 19, 2007, 02:15:10 am »
if you want it, compile this (and finish it) into trem.
http://icculus.org/~phaethon/q3a/q3sh/q3sh.html
Any maps not in the MG repo?  Email me or come to irc.freenode.net/#mg.
--
My words are mine and mine alone.  I can't speak for anyone else, and there is no one who can speak for me.  If I ever make a post that gives the opinions or positions of other users or groups, then they will be clearly labeled as such.
I'm disappointed that people's past actions have forced me to state what should be obvious.
I am not a dev.  Nothing I say counts for anything.

FisherP

  • Posts: 295
  • Turrets: +31/-32
Client-side Scripting
« Reply #17 on: February 27, 2007, 01:38:18 am »
I wouldn't mind of if..then..else statements within the client side console, makes for a more flexible bind system.

As for spam the only way to really prevent it is on the server side in a qvm. I don't care much atm for a goto, and don't see the need for functions or subroutines. Just a better way of doing what we do now, if I'm a granger then I want to build stuff, if I am a human with a ckit, I want to build other stuff. It would be nice to not have to concern myself with what my keys are bound to, it could/should be automatic.

kevlarman

  • Posts: 2737
  • Turrets: +291/-295
Client-side Scripting
« Reply #18 on: February 27, 2007, 01:45:12 am »
Quote from: "FisherP"
I wouldn't mind of if..then..else statements within the client side console, makes for a more flexible bind system.

As for spam the only way to really prevent it is on the server side in a qvm. I don't care much atm for a goto, and don't see the need for functions or subroutines. Just a better way of doing what we do now, if I'm a granger then I want to build stuff, if I am a human with a ckit, I want to build other stuff. It would be nice to not have to concern myself with what my keys are bound to, it could/should be automatic.
this is already possible by separating binds into humans.cfg and aliens.cfg and binding 2 keys to "team humans;exec humans" and "team aliens;exec aliens".
Quote from: Asvarox link=topic=8622.msg169333#msg169333
Ok let's plan it out. Asva, you are nub, go sit on rets, I will build, you two go feed like hell, you go pwn their asses, and everyone else camp in the hallway, roger?
the dretch bites.
-----
|..d| #
|.@.-##
-----

Rawr

  • Posts: 918
  • Turrets: +1/-1
Client-side Scripting
« Reply #19 on: February 27, 2007, 03:10:35 pm »
I would like client side scripting in the tjw command blocks. So you can do intergers and usernames/slot numbers and such.
img]http://dvclan.org/statsig/statsig.php/3826/4.jpg[/img]

Undeference

  • Tremulous Developers
  • *
  • Posts: 1254
  • Turrets: +122/-45
Client-side Scripting
« Reply #20 on: February 27, 2007, 06:23:16 pm »
Quote from: "bazuka_poo"
I would like client side scripting in the tjw command blocks. So you can do intergers and usernames/slot numbers and such.
Do I even need to point out where that went wrong?
Need help? Ask intelligently. Please share solutions you find.

Thats what we need, helpful players, not more powerful admins.

daenyth

  • Posts: 230
  • Turrets: +21/-26
Client-side Scripting
« Reply #21 on: February 27, 2007, 07:49:28 pm »
Quote from: "kevlarman"
Quote from: "FisherP"
I wouldn't mind of if..then..else statements within the client side console, makes for a more flexible bind system.

As for spam the only way to really prevent it is on the server side in a qvm. I don't care much atm for a goto, and don't see the need for functions or subroutines. Just a better way of doing what we do now, if I'm a granger then I want to build stuff, if I am a human with a ckit, I want to build other stuff. It would be nice to not have to concern myself with what my keys are bound to, it could/should be automatic.
this is already possible by separating binds into humans.cfg and aliens.cfg and binding 2 keys to "team humans;exec humans" and "team aliens;exec aliens".


But more along the lines of
Code: [Select]

/bind key rebind()
sub rebind {
  if ("$team" eq "aliens") {
    exec alienbinds.cfg
    if ("$class" eq "builder") {
      exec alienbuilder.cfg
    }
  } elsif ("$team" eq "humans") {
    exec humanbinds.cfg
  }
}


etc, etc
Quote from: Bullislander05
It's like trying to take apple seeds out of a zebra to plant a giraffe tree.

Smokey

  • Posts: 793
  • Turrets: +23/-58
    • Zilla Clan
Client-side Scripting
« Reply #22 on: February 27, 2007, 08:02:12 pm »
Every one of these examples has been in a different format. If this is done, I think it should follow the mIRC scripting system (Due to its ease)

Code: [Select]

if ($stage == 1) {
 say_team We need stage 2!
}
elseif ($stage == 2) {
 say_team We need stage 3!
}
else {
 say_team WTF WE NEED A STAGE OMGBBQHAX
}

David

  • Spam Killer
  • *
  • Posts: 3543
  • Turrets: +249/-273
Client-side Scripting
« Reply #23 on: February 28, 2007, 12:08:13 am »
mIRC lacks quotes around strings.
IMO that sort of stupidity makes it good for nothing.
If you want a full scripting language, embed perl.
Or better still bash,
Any maps not in the MG repo?  Email me or come to irc.freenode.net/#mg.
--
My words are mine and mine alone.  I can't speak for anyone else, and there is no one who can speak for me.  If I ever make a post that gives the opinions or positions of other users or groups, then they will be clearly labeled as such.
I'm disappointed that people's past actions have forced me to state what should be obvious.
I am not a dev.  Nothing I say counts for anything.

Paradox

  • Posts: 2612
  • Turrets: +253/-250
    • Paradox Designs
Client-side Scripting
« Reply #24 on: February 28, 2007, 04:42:04 am »
or better yet, C

∧OMG ENTROPY∧

Smokey

  • Posts: 793
  • Turrets: +23/-58
    • Zilla Clan
Client-side Scripting
« Reply #25 on: February 28, 2007, 11:55:25 am »
Quote from: "David"
mIRC lacks quotes around strings.
IMO that sort of stupidity makes it good for nothing.
If you want a full scripting language, embed perl.
Or better still bash,

simplicity.

Matt2k10

  • Posts: 144
  • Turrets: +11/-8
Client-side Scripting
« Reply #26 on: February 28, 2007, 01:06:10 pm »
Make it like python!

FisherP

  • Posts: 295
  • Turrets: +31/-32
Client-side Scripting
« Reply #27 on: March 01, 2007, 06:52:04 pm »
Quote from: "kevlarman"
Quote from: "FisherP"
I wouldn't mind of if..then..else statements within the client side console, makes for a more flexible bind system.

As for spam the only way to really prevent it is on the server side in a qvm. I don't care much atm for a goto, and don't see the need for functions or subroutines. Just a better way of doing what we do now, if I'm a granger then I want to build stuff, if I am a human with a ckit, I want to build other stuff. It would be nice to not have to concern myself with what my keys are bound to, it could/should be automatic.
this is already possible by separating binds into humans.cfg and aliens.cfg and binding 2 keys to "team humans;exec humans" and "team aliens;exec aliens".

I already work my binds this way ref: http://tremulous.net/phpBB2/viewtopic.php?t=1240, but it would be easier if the system just knew, in order for me to set my binds up for a builder at the start of a game I need to hit two keys, I'm not complaining, it's a good system, but I think it can be improved.

Quote from: "daenyth"
But more along the lines of
Code: [Select]

/bind key rebind()
sub rebind {
  if ("$team" eq "aliens") {
    exec alienbinds.cfg
    if ("$class" eq "builder") {
      exec alienbuilder.cfg
    }
  } elsif ("$team" eq "humans") {
    exec humanbinds.cfg
  }
}



etc, etc

No, not like that because you can do this in separate cfg files, more like (i don't know the syntax so this is more at concept level)
Code: [Select]

/bind key buildsomething()
sub buildsomething {
  if ("$item" eq "ckit") {
      bind key (build something human)}
  elsif ("$class" eq "builder") {
      bind key (build something alien) }
}