News:

Come Chat with us live! Learn how HERE!

Main Menu

Client-side Scripting

Started by daenyth, February 15, 2007, 04:39:04 PM

Do we need a client-side scripting system?

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

Total Members Voted: 22

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

daenyth

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

Shouldn't it rather be a server-side scripting system? Client-side would only make things bad.

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.
I'm playing Tremulous on a Mac!
MGDev fan-club member
Techhead||TH
/"/""\"\
\"\""/"/
\\:.V.://
Copy and paste Granger into your signature!

daenyth

Quote from: OdinShouldn'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

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

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

Quote from: daenythWhat NOT to implement?
for (spam concerns)
while (spam)
goto (spam)
What else?
Some corrections in what NOT to implement;
goto (goto)
; (spam)
functions (spam)
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

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

All you need is:
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


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: CavemanNothing can be made idiot-prove ...

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.
Need help? Ask intelligently. Please share solutions you find.

Quote from: tuple on February 15, 2008, 11:54:10 PMThats what we need, helpful players, not more powerful admins.

Risujin

(loop for i across #(1 2 3) do (ap ("print \"omg its 1958 all over again\n\"")))

DASPRiD

Quote from: techheadWhy 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.

techhead

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

One thing that is being mentioned is conditionals, if, else, etc. Loops would be great, for example:
//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

Quote from: UndeferenceSurprise 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

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

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

Quote from: FisherPI 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#msg169333Ok 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

I would like client side scripting in the tjw command blocks. So you can do intergers and usernames/slot numbers and such.

Undeference

Quote from: bazuka_pooI 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.

Quote from: tuple on February 15, 2008, 11:54:10 PMThats what we need, helpful players, not more powerful admins.

daenyth

Quote from: kevlarman
Quote from: FisherPI 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

/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

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)


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

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


∧OMG ENTROPY∧

Smokey

Quote from: DavidmIRC 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


FisherP

Quote from: kevlarman
Quote from: FisherPI 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: daenythBut more along the lines of

/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)

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