x


Linking 2 script variables (min + max) to one editor bar - MinMaxSlider?

Is there a way to highlight the link between 2 script variables so that the editor will display them in a linked (min/max) fashion?

So instead of this display in the editor:

SpawnTimeMin : 5
SpawnTimeMax : 8
LeashDistMin : 15
LeashDistMax : 35

I would have something like

SpawnTimeMin / SpawnTimeMax : 5-8
LeashDistMin / LeashDistMax : 15-35

In my scripts I have a lot of dual variables for min and max, for example SpawnTimeMin SpawnTimeMax, LeashDistMin, LeashDistMax. Depending on a monster type these variables are different and i'd like to set them in the editor.

At the moment I'm simply having to change 2 numbers, but I noticed there is a nice built in bar called MinMaxSlider, where you can change 2 numbers with only 1 row, and it gives you a nice visual explanation of the values. Is this something I can somehow take advantage of?

more ▼

asked Sep 22 '11 at 02:09 PM

mouseman919 gravatar image

mouseman919
1 7 8 8

Yes, indeed it is- but you'll need to create a custom editor to be able to use it. In most cases, it's more trouble than it's worth, but on the other hand, if you're up to the (reasonably straightforward) challenge, it's useful to know how to do.

Sep 22 '11 at 02:29 PM syclamoth

That does sound like more trouble than it's worth. However, out of interest, what would the general process be? Would I have to define my own parser to detect a certain new keyword or struct?

I was hoping for something along the lines of:

     var SpawnTimeMin : float;
     var SpawnTimeMax : float; 
     @link SpawnTimeMin, SpawnTimeMax;

I guess I could make a class / struct that contains min and max variables then have the editor have a custom slider to represent that struct / class type or something?

Sep 22 '11 at 03:09 PM mouseman919
(comments are locked)
10|3000 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x3340
x1677
x344
x73
x4

asked: Sep 22 '11 at 02:09 PM

Seen: 637 times

Last Updated: Sep 22 '11 at 03:22 PM