Jump to content


Photo

inc and dec console commands or math operations


  • Please log in to reply
9 replies to this topic

#1 SuaveSteve

SuaveSteve

    Member

  • Member
  • PipPip
  • 45 posts

Posted 13 October 2018 - 09:43 PM

So I realise that Doom 3's console cannot understand math operations. This is a massive bummer, cause I cannot do this:

 

bind = set r_gamma (r_gamma + 0.05)

 

...in order to implement Thief's ability to change gamma on the fly.

 

I suppose ZDoom's console has spoiled me.

 

If implementing basic arithmetic is going to be a tall order, could we at least get inc and dec commands? They would simply inc/dec a cvar by a given parameter.

 

Eg: bind = inc r_gamma 0.05


  • nbohr1more likes this

#2 duzenko

duzenko

    Advanced Member

  • Active Developer
  • PipPipPip
  • 1814 posts

Posted 14 October 2018 - 12:35 AM

So I realise that Doom 3's console cannot understand math operations. This is a massive bummer, cause I cannot do this:

 

bind = set r_gamma (r_gamma + 0.05)

 

...in order to implement Thief's ability to change gamma on the fly.

 

I suppose ZDoom's console has spoiled me.

 

If implementing basic arithmetic is going to be a tall order, could we at least get inc and dec commands? They would simply inc/dec a cvar by a given parameter.

 

Eg: bind = inc r_gamma 0.05

@all

can we bind a key to execute a script?



#3 stumpy

stumpy

    Advanced Member

  • Member
  • PipPipPip
  • 1870 posts

Posted 14 October 2018 - 06:56 AM

how does gamma work in the option guis for gamma, you should be able to add something like that and change it on the fly, as in game or not in game its would be the same.

 

eg stick gui +/- buttons somewhere on main game screen and use them to change gamma. would have to be optional like the other optional things.


Edited by stumpy, 14 October 2018 - 06:58 AM.


#4 HMart

HMart

    Advanced Member

  • Member
  • PipPipPip
  • 747 posts

Posted 14 October 2018 - 08:51 AM

@all

can we bind a key to execute a script?

 

afaik you can bind a key to run a script function  https://modwiki.xnet...onsole_command)

 

bind F11 script "function name"

 

I never tried it so don't take my word for it. 


Edited by HMart, 14 October 2018 - 08:55 AM.


#5 Skaruts

Skaruts

    Member

  • Member
  • PipPip
  • 279 posts

Posted 16 October 2018 - 05:52 PM

What language should scripts be in?



#6 HMart

HMart

    Advanced Member

  • Member
  • PipPipPip
  • 747 posts

Posted 16 October 2018 - 07:59 PM

What language should scripts be in?

 

scripts use a very simple custom OOP (object oriented programing), c/c++ like, language made by idsoftware called, id script, even tho is a very simple language, is also very powerful, anyone with basic knowledge of OOP and programing can do immense stuff in TDM with it.

 

https://modwiki.xnet.fi/Scripting


Edited by HMart, 16 October 2018 - 08:00 PM.


#7 161803398874989

161803398874989

    Member

  • Member
  • PipPip
  • 399 posts

Posted 17 October 2018 - 02:50 PM

 

scripts use a very simple custom OOP (object oriented programing), c/c++ like, language made by idsoftware called, id script, even tho is a very simple language, is also very powerful, anyone with basic knowledge of OOP and programing can do immense stuff in TDM with it.

 

https://modwiki.xnet.fi/Scripting

Technically scripting is powerful enough to rebuild Doom inside TDM!


You can call me Phi, Numbers, Digits, Ratio, 16, 1618, or whatever really, as long as it's not Phil.

#8 HMart

HMart

    Advanced Member

  • Member
  • PipPipPip
  • 747 posts

Posted 18 October 2018 - 05:13 PM

Technically scripting is powerful enough to rebuild Doom inside TDM!

 

Is technically possible but IMO very very hard, id script language lacks some important things that C/C++ have, arrays is a big one, and those are pretty much required to make any game, technically the vector class (idVec3 in c++) could be thought as a array with three indexes, but you can't do much with it in id script but save 3 float values on it, you can't for example make a vector of 3 objects/entities, pointers is another thing that id script lacks, the $entityname is technically a "pointer to a entity" but its single use is to get entities already spawned in the game nothing else.



#9 stgatilov

stgatilov

    Lead Programmer

  • Active Developer
  • PipPipPip
  • 1126 posts

Posted 22 October 2018 - 08:12 AM

I think you don't have access to cvars inside scripting system.

 

It should not be hard to implement basic arithmetics in console.

For instance, add a command "set" which parses its arguments as arithmetic expression with cvars in it.



#10 VanishedOne

VanishedOne

    Advanced Member

  • Member
  • PipPipPip
  • 868 posts

Posted 22 October 2018 - 08:29 AM

I think you don't have access to cvars inside scripting system.

You do: idThread has getcvar() and setcvar() script events.


Some things I'm repeatedly thinking about...

- louder scream when you're dying





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users