MantisBT - Zandronum
View Issue Details
0001706Zandronum[All Projects] Suggestionpublic2014-02-13 16:502014-07-29 13:30
ibm5155 
 
normalfeatureN/A
newopen 
X648.1XP/Vista/7
2.0-beta 
 
0001706: client side global variable
With this, it would be able to have a certain global variable that would have the same values into serverside and clientside.

So if the server change the data that was into a clientside global var, it would update the clientside global var too.

And people who makes use of clientside scripts sometimes want to use serverside data to make print some texts(would save alot of data traffic) or even some effects, so it would make the scripts much more easy to be done (instead to update each clientside data with acs_execute(x,0,data1,data2,data2))

Mods that may would have use of it:
-Who Dun It (storing who is the murder for print the blood bar, and for printing with a 'X' where the last humans are on screen)
-Flappy Lost Soul(clientside messages and clientside player list)
-other mods that uses clientside menus, alot of prints and specific player effects...
ex: on a multiplayer game.

int data=1 clientside;


script 1 open{
 while(data<10000){
 data=data*2
 delay(35);
 }
}

script 2 open clientside{
 while(true){
 print(d:data);
 delay(1);
 }
}
print outup:"1" "2" "4" "8" "16" "32" "64" "128" "256" "512" "1024" "2048",...
output without data being clientside:"1" "1" "1" "1" "1" "1" "1"
barraI hope people understood what did I wrote, if not I can rewrite it :)
No tags attached.
Issue History
2014-02-13 16:50ibm5155New Issue
2014-04-09 19:43ibm5155Note Added: 0008528
2014-06-15 16:10WatermelonNote Added: 0009442
2014-06-15 16:10WatermelonStatusnew => feedback
2014-06-17 02:23ibm5155Note Added: 0009536
2014-06-17 02:23ibm5155Statusfeedback => new
2014-07-29 03:30WatermelonNote Added: 0010069
2014-07-29 03:31WatermelonNote Edited: 0010069bug_revision_view_page.php?bugnote_id=10069#r5420
2014-07-29 13:30ZzZomboNote Added: 0010083

Notes
(0008528)
ibm5155   
2014-04-09 19:43   
what about a tag like global?
if a var would receive this flag, it would have synchronized values betw server and client.
ex:
global int total_imps;
(0009442)
Watermelon   
2014-06-15 16:10   
Why can't you pass them to the client via script puking?

SERVER -> CLIENTSIDE (-> CLIENTSIDE NET) which sets it?
(0009536)
ibm5155   
2014-06-17 02:23   
well the only way I know to pass serverside data to clientside is by acs execute, but, you can only pass 3 arguments on a single call...

And like on my last mods/maps I had to transfer more than 30 arguments D:

I was having two solutions
1)use one argument to control what var should be update ex:
acs_execute(1,1,5,4);
script 1(int control, int a, int b){
 switch(control){
 case 1:
  data[0]=a;
  data[1]=b];
...
}

2) make alot of scripts just to tranfer data

Well, I just wanted a way where people wouldn't be require to use that weird methods, and you need to make controls for it D:.

I actually use alot clientside to print strings, since it actually eat alot of internet data, so instead of a server side loop printing "murder:name" you just send the number of the murder to client...

If there's another easier way to make it pls tell me D:
(0010069)
Watermelon   
2014-07-29 03:30   
(edited on: 2014-07-29 03:31)
You'll have to pass 30 ACS calls, it's annoying... I know.


ACS_Exceute the script number, and pass a constant and the index shifted together so it uses up one slot. If you know your numbers are n bits long, you could try to fit multiple numbers into one arg by using them as a bit field.

Otherwise, 30 ACS executes it is ;)

(0010083)
ZzZombo   
2014-07-29 13:30   
Another method is to use dummy actors, and use some their properties as values, like the speed of MyDummy is the count of all players deaths.