[ DEV ] InfinityScript Suggestions

InfinityScript plugins for dedicated servers.
User avatar
~Lambder
TeknoSheep
Posts: 448
Joined: Thu Apr 11, 2013 5:40 pm
Location: Meadow.
Contact:

Re: [ DEV ] InfinityScript Suggestions

Postby ~Lambder » Mon Feb 01, 2016 10:00 pm

c4271605 wrote:
Lambder wrote:
c4271605 wrote:- SetPersistentDvar - Sets a dvar the client saves even after leaving the server and restarting their game

Well that caught my eye. Is it a built-in function?

And about the modified IS you are coding, you might want to wait for the tg4.0 update. There are some new things in there.

P.S. Glad you aren't a .NET-sucks-scrub.

Yep, it is.

Edit, you can access client dvars tho :|


Not sure how I can read them though. Also, could you tell me in a PM or something or even publicly how to set persistent dvars and read them from clients?
Don't worry, you'll be credited. (I'm not much of a reverser, so don't hate)
User avatar
~Seraphim
TeknoHorse
TeknoHorse
Posts: 1186
Joined: Sun Jan 12, 2014 10:36 pm

Re: [ DEV ] InfinityScript Suggestions

Postby ~Seraphim » Tue Feb 02, 2016 2:18 am

Lambder wrote:
c4271605 wrote:
Lambder wrote:
c4271605 wrote:- SetPersistentDvar - Sets a dvar the client saves even after leaving the server and restarting their game

Well that caught my eye. Is it a built-in function?

And about the modified IS you are coding, you might want to wait for the tg4.0 update. There are some new things in there.

P.S. Glad you aren't a .NET-sucks-scrub.

Yep, it is.

Edit, you can access client dvars tho :|


Not sure how I can read them though. Also, could you tell me in a PM or something or even publicly how to set persistent dvars and read them from clients?
Don't worry, you'll be credited. (I'm not much of a reverser, so don't hate)


Image

Then you can read them:

Code: Select all

self.IPrintLnBold( "Dvar Value: " + self.Call< string >( "getDvar", "myDvar" ) );


You can optionally use the template method I wrote as a part of Entity:
Image

Thus using the above i can simply type:

Code: Select all

self.SetPersistentDvar( "myDvar", "This is an example" );

self.iPrintLnBold( "Value: " + self.GetClientDvar( "myDvar" ) );
User avatar
~Lambder
TeknoSheep
Posts: 448
Joined: Thu Apr 11, 2013 5:40 pm
Location: Meadow.
Contact:

Re: [ DEV ] InfinityScript Suggestions

Postby ~Lambder » Tue Feb 02, 2016 8:21 am

c4271605 wrote:
Lambder wrote:
c4271605 wrote:
Lambder wrote:
c4271605 wrote:- SetPersistentDvar - Sets a dvar the client saves even after leaving the server and restarting their game

Well that caught my eye. Is it a built-in function?

And about the modified IS you are coding, you might want to wait for the tg4.0 update. There are some new things in there.

P.S. Glad you aren't a .NET-sucks-scrub.

Yep, it is.

Edit, you can access client dvars tho :|


Not sure how I can read them though. Also, could you tell me in a PM or something or even publicly how to set persistent dvars and read them from clients?
Don't worry, you'll be credited. (I'm not much of a reverser, so don't hate)


Image

Then you can read them:

Code: Select all

self.IPrintLnBold( "Dvar Value: " + self.Call< string >( "getDvar", "myDvar" ) );


You can optionally use the template method I wrote as a part of Entity:
Image

Thus using the above i can simply type:

Code: Select all

self.SetPersistentDvar( "myDvar", "This is an example" );

self.iPrintLnBold( "Value: " + self.GetClientDvar( "myDvar" ) );


I'll check that out when I get back home and I'll report back with the results.

Since they are persistent dvars, I guess I can put any of the built in GSC types, right? like floats, ints etc. Value types, that is.



User avatar
Slvr99
TeknoPrincess
TeknoPrincess
Posts: 270
Joined: Wed Apr 18, 2012 7:53 pm
Location: Florida
Contact:

Re: [ DEV ] InfinityScript Suggestions

Postby Slvr99 » Tue Feb 02, 2016 10:24 am

c4271605 wrote:Edit, you can access client dvars tho :|

How so? There isn't a "getClientDVAR" function and you can't even get them in the actual game's GSC. "getDVAR" gets a server DVAR, not a client one.
User avatar
~Seraphim
TeknoHorse
TeknoHorse
Posts: 1186
Joined: Sun Jan 12, 2014 10:36 pm

Re: [ DEV ] InfinityScript Suggestions

Postby ~Seraphim » Tue Feb 02, 2016 11:47 am

Slvr99 wrote:
c4271605 wrote:Edit, you can access client dvars tho :|

How so? There isn't a "getClientDVAR" function and you can't even get them in the actual game's GSC. "getDVAR" gets a server DVAR, not a client one.

Bet you didn't know.
Call "iprintln" via Function.Call<T> and you end up executing a global function.
But calling it on a entity allows you to execute it for the client.

Example would be in GSC:

Code: Select all

self iprintlnbold("Test");


And yes dvars support all primitive types
User avatar
Slvr99
TeknoPrincess
TeknoPrincess
Posts: 270
Joined: Wed Apr 18, 2012 7:53 pm
Location: Florida
Contact:

Re: [ DEV ] InfinityScript Suggestions

Postby Slvr99 » Tue Feb 02, 2016 11:51 am

c4271605 wrote:Bet you didn't know.
Call "iprintln" via Function.Call<T> and you end up executing a global function.
But calling it on a entity allows you to execute it for the client.

Example would be in GSC:

Code: Select all

self iprintlnbold("Test");


And yes dvars support all primitive types

I knew that, but calling getDvar on an Entity still checks the server DVAR. That's the same reason there's a "setClientDvar" function instead of using "self setDvar"
You can tell since "getDvar" and "setDvar" are listed under "global stuff #2" in IS, not "playercmd". Trust me, I've been using IS since it's release =P
User avatar
~Lambder
TeknoSheep
Posts: 448
Joined: Thu Apr 11, 2013 5:40 pm
Location: Meadow.
Contact:

Re: [ DEV ] InfinityScript Suggestions

Postby ~Lambder » Tue Feb 02, 2016 1:29 pm

Slvr99 wrote:
c4271605 wrote:Bet you didn't know.
Call "iprintln" via Function.Call<T> and you end up executing a global function.
But calling it on a entity allows you to execute it for the client.

Example would be in GSC:

Code: Select all

self iprintlnbold("Test");


And yes dvars support all primitive types

I knew that, but calling getDvar on an Entity still checks the server DVAR. That's the same reason there's a "setClientDvar" function instead of using "self setDvar"
You can tell since "getDvar" and "setDvar" are listed under "global stuff #2" in IS, not "playercmd". Trust me, I've been using IS since it's release =P


Hm.
What about

Code: Select all

Function.SetEntRef(Entity.EntRef);
T = Function.Call<T>("GetDvar", string);


Afaik, this is exactly what Entity.Call does.



User avatar
Slvr99
TeknoPrincess
TeknoPrincess
Posts: 270
Joined: Wed Apr 18, 2012 7:53 pm
Location: Florida
Contact:

Re: [ DEV ] InfinityScript Suggestions

Postby Slvr99 » Tue Feb 02, 2016 3:06 pm

Lambder wrote:
Slvr99 wrote:
c4271605 wrote:Bet you didn't know.
Call "iprintln" via Function.Call<T> and you end up executing a global function.
But calling it on a entity allows you to execute it for the client.

Example would be in GSC:

Code: Select all

self iprintlnbold("Test");


And yes dvars support all primitive types

I knew that, but calling getDvar on an Entity still checks the server DVAR. That's the same reason there's a "setClientDvar" function instead of using "self setDvar"
You can tell since "getDvar" and "setDvar" are listed under "global stuff #2" in IS, not "playercmd". Trust me, I've been using IS since it's release =P


Hm.
What about

Code: Select all

Function.SetEntRef(Entity.EntRef);
T = Function.Call<T>("GetDvar", string);


Afaik, this is exactly what Entity.Call does.

It is the same as Entity.Call. Go ahead and try it yourself if you want to see it. That doesn't get an Entity's DVAR, it gets the server's DVAR even when called on an Entity.
User avatar
~Lambder
TeknoSheep
Posts: 448
Joined: Thu Apr 11, 2013 5:40 pm
Location: Meadow.
Contact:

Re: [ DEV ] InfinityScript Suggestions

Postby ~Lambder » Sun Feb 07, 2016 2:58 pm

You know something I'd really like?
A working destructor for the scripts that gets called right before they are unloaded.

This way, we can do so much more stuff. Too bad it needs some kind of hooking and possibly changing the tekno source.



User avatar
Boboo
TeknoDev
Posts: 145
Joined: Thu Jul 23, 2015 3:41 pm

Re: [ DEV ] InfinityScript Suggestions

Postby Boboo » Sun Feb 07, 2016 3:23 pm

Lambder wrote:You know something I'd really like?
A working destructor for the scripts that gets called right before they are unloaded.

This way, we can do so much more stuff. Too bad it needs some kind of hooking and possibly changing the tekno source.


The destructor was working actually when I used it...

Code: Select all

~<Constructor> {...}
Image

Return to “InfinityScript”

Who is online

Users browsing this forum: No registered users and 3 guests