cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 
Developer forum

GDL - get value before parameter change

Darwuhr
Enthusiast

If I change the vakue of a paramter, either via objects settings dialog or editable hotspot, can I get the value of the parameter before the change? Example I change the parameter x1 via editable hotspot. I want to store the value of x1 before the change so I can do some extra needed calculations. So I will have the x1 param with the new value and another param that will have the value of x1 before the change.

3 REPLIES 3

runxel
Ace

Use a shadow parameter for that.

Mostly AC 26 on Mac | Author of SelfGDL | Developer of the GDL plugin for Sublime Text |
«Furthermore, I consider that Carth... yearly releases must be destroyed»

Could you explain what a shadow parameter is and how to apply one?

It's called like that because you're shadowing one parameter to another, invisible one (for the user).

Just make two parameters for every parameter setting you'll need. One is hidden for the user ('X' it), the other one is the main input.

 

Pseudocode:

! ::Master or Param script::
if GLOB_MODPAR_NAME = "myparam" then
	! do your calculations
	...
	! finally mirror the current value to the shadow parameter:
	myshadowparam = myparam
endif

! … and set the parameter value
parameters 	myshadowparam = myshadowparam

 

 

Mostly AC 26 on Mac | Author of SelfGDL | Developer of the GDL plugin for Sublime Text |
«Furthermore, I consider that Carth... yearly releases must be destroyed»

Still looking?

Browse more topics

Back to forum

See latest solutions

Accepted solutions

Start a new discussion!