UGX-Mods

Call of Duty 5: World at War => Help Desk => Scripting => Topic started by: MakeCents on February 27, 2016, 06:24:36 pm

Title: Set forecolor based on if condition menu
Post by: MakeCents on February 27, 2016, 06:24:36 pm
I have seen this in menus, and was wondering if I could use this to set the rect based on a dvar?

Code Snippet
Plaintext
#ifndef PC
rect -47 -40 54 27
#else // #ifndef PC
rect (WEAPINFO_X +116) (WEAPINFO_Y +15) 80 40
#endif // #ifndef PC

I want to so something like:
Code Snippet
Plaintext
#if(dvarstring("test")=="yes")
forecolor 1 1 1 1
#else
forecolor .2 .2 0 .5
#endif

Which didn't work...
Title: Re: Set rect based on if condition menu
Post by: DeletedUser on February 27, 2016, 06:31:57 pm
if you want to set a rect based on a specific condition, you have to create 2 or more itemDefs for each condition.
Title: Re: Set rect based on if condition menu
Post by: MakeCents on February 27, 2016, 06:33:57 pm
if you want to set a rect based on a specific condition, you have to create 2 or more itemDefs for each condition.

I've done that but for some reason I'm at some type of limit where if I add any more itemdefs, it crashes without the T4M mod. I don't really understand why, but I have randomly commented out 2 itemdefs and it works. So I am trying to consolidate some.
Title: Re: Set rect based on if condition menu
Post by: DeletedUser on February 27, 2016, 06:34:45 pm
I've done that but for some reason I'm at some type of limit where if I add any more itemdefs, it crashes without the T4M mod. I don't really understand why, but I have randomly commented out 2 itemdefs and it works. So I am trying to consolidate some.
Not possible, sorry.
Title: Re: Set rect based on if condition menu
Post by: MakeCents on February 27, 2016, 06:36:46 pm
Not possible, sorry.

lolol, I said the same thing and after two days of testing, I cannot see any other solution. I've commented out itemdefs with the same materials, with different materials, in different menudefs, and same results. So I am not sure what is causing the issue, but I would like to use one item def for two purposes atm. I have found another way around the images issue I was having, but I would also like to adjust the forecolor.
Title: Re: Set rect based on if condition menu
Post by: alaurenc9 on February 27, 2016, 08:39:18 pm
#define DVAR_IS_TRUE ( dvarstring( "test" )=="yes ")
#ifdef  DVAR_IS_TRUE
         forecolor      1 1 1 1
#else
         forecolor      .2 .2 0 .5
#endif
Title: Re: Set rect based on if condition menu
Post by: DeletedUser on February 27, 2016, 08:43:12 pm
#define DVAR_IS_TRUE ( dvarstring( "test" )=="yes ")
#ifdef  DVAR_IS_TRUE
         forecolor      1 1 1 1
#else
         forecolor      .2 .2 0 .5
#endif
this won't work
Title: Re: Set rect based on if condition menu
Post by: alaurenc9 on February 27, 2016, 09:01:07 pm
Stuff like that worked very well for me. Don't see why not.
Title: Re: Set rect based on if condition menu
Post by: DidUknowiPwn on February 28, 2016, 01:38:19 am
You can modify position using exp check main.menu for fog scrolling.
Title: Re: Set rect based on if condition menu
Post by: MakeCents on February 28, 2016, 02:12:25 am
#define DVAR_IS_TRUE ( dvarstring( "test" )=="yes ")
#ifdef  DVAR_IS_TRUE
         forecolor      1 1 1 1
#else
         forecolor      .2 .2 0 .5
#endif

This behaved as if it was always defined.


You can modify position using exp check main.menu for fog scrolling.

sorry, I said rect in title, I meant forecolor.

I tried this:
Code Snippet
Plaintext
#define PERK_COLOR		1 (dvarint("powerswitch")) (dvarint("powerswitch")) 1

//in itemdef
forecolor PERK_COLOR

but that didn't work for me either


Not possible, sorry.

I just went down to the compass itemdefs and commented them out, now I can have all the ones I wanted in and it doesn't matter anymore. Still don't know why, but its working with those commented out.
Title: Re: Set forecolor based on if condition menu
Post by: alaurenc9 on February 28, 2016, 02:54:47 am
Yeah editing forecolor, besides alpha, I do not think is possible. I tried exp forecolor R, G, and B and also exp forecolor C for the whole color all together, and mod builder said only 'A' for alpha works. And you cannot use dvars on anything but 'exp' and 'visible when();' so yeah the only way to change the color is making different ItemDef's which is kinda limiting.
Title: Re: Set forecolor based on if condition menu
Post by: DidUknowiPwn on February 28, 2016, 05:27:59 pm
If you want to change the color you can do exp R,G,B,A which controls forecolor

Wait I'll check into waw later the colors should be supported.
Title: Re: Set forecolor based on if condition menu
Post by: alaurenc9 on February 28, 2016, 06:44:50 pm
If you want to change the color you can do exp R,G,B,A which controls forecolor

Wait I'll check into waw later the colors should be supported.

No you cannot. I tried this and launcher gave me an error saying it expected only "A".