Page 1 of 1

Need Help Scirpting - I keep getting Underteminenated Limits of Instruction Block

Posted: 07 Jan 2020, 23:38
by TheQuestionMark
Hi!
I keep getting errors and I don't know how to script paper texture. I want to make it if the paper texture is on and the same, that it does nothing. If it's different or off it turns on and set the paper texture

Here's the code:

Code: Select all

tv_paper Hardness 82 Invert 1 Size 0.701800 Angle 0.000000 OffsetX 0.000000 OffsetY 0.000000 FlipX 0 FlipY 0 Active 1 Name "/Paper 01"

IF

tv_paper Hardness 82 Invert 1 Size 0.701800 Angle 0.000000 OffsetX 0.000000 OffsetY 0.000000 FlipX 0 FlipY 0 Active 1 Name "/Paper 01"

THEN

tv_nop

END
What am I doing wrong? I have do this script because there's this annoying lag when hopping between eraser(no texture) and sketch pencil (texture) when drawing and accidently repressing sketch pencil causing the lag.

Re: Need Help Scirpting - I keep getting Underteminenated Limits of Instruction Block

Posted: 08 Jan 2020, 01:12
by Svengali
No THEN in GEORGE, and IF needs to evaluate something to be true or false, right?

Code: Select all

IF A == 5
     B = 10
END

Re: Need Help Scirpting - I keep getting Underteminenated Limits of Instruction Block

Posted: 08 Jan 2020, 05:54
by Hironori Takagi
I write the script that you want.

---
tv_GetActiveTool
PARSE result toolname others
IF CMP(toolname,"tv_penbrush") == 1
tv_Paper Hardness 82 Invert 1 Size 0.701800 Angle 0.000000 OffsetX 0.000000 OffsetY 0.000000 FlipX 0 FlipY 0 Active 1 Name "/Paper 01"
ELSE
tv_Paper Active 0
END

Re: Need Help Scirpting - I keep getting Underteminenated Limits of Instruction Block

Posted: 08 Jan 2020, 10:54
by Thierry
Svengali is right, in George, there's no THEN, and IF needs to be a basic true or false evaluation.
Your condition was way too complex for George, that's why it wasn't working.

Hironori Takagi's script is the correct way to do it.

Re: Need Help Scirpting - I keep getting Underteminenated Limits of Instruction Block

Posted: 08 Jan 2020, 19:33
by TheQuestionMark
Thierry wrote: 08 Jan 2020, 10:54 Svengali is right, in George, there's no THEN, and IF needs to be a basic true or false evaluation.
Your condition was way too complex for George, that's why it wasn't working.

Hironori Takagi's script is the correct way to do it.
I tried the script. It doesn't seem to work. It takes a good 2 secounds when switching to my texture pencil tool. Try spamming the hotkey while stroking you can see your strokes lag when switching to texture tool pencil. Can you patch this annoying problem it's really annoying I can never use texture paper because of the annoying lag, switching and retapping the texture pencil tool. Also there seems to be a bug, it doesn't switch papers if you use .grg scripts. I address this problem for a long time and there's still hasn't been a patch for this. It needs to load faster like milliseconds. Two second lag for stroking takes forever and that's from single line of code:

Code: Select all

 tv_paper Hardness 82 Invert 1 Size 0.701800 Angle 0.000000 OffsetX 0.000000 OffsetY 0.000000 FlipX 0 FlipY 0 Active 1 Name "/Paper 01"
Can make quick patch for this I don't want to wait months or even years for this. Load the texture into RAM for three types as a limit.

Re: Need Help Scirpting - I keep getting Underteminenated Limits of Instruction Block

Posted: 08 Jan 2020, 20:53
by TheQuestionMark
It seems to work Faster if you place the Grab Tool First and the Script 2nd. But why is that? Is it programming error, when you place the Script first, then Grab Tool second? It still lags a bit.

Re: Need Help Scirpting - I keep getting Underteminenated Limits of Instruction Block

Posted: 09 Jan 2020, 03:54
by Hironori Takagi
I tried to make the script "pen <-> eraser with paper 01 texture on". If this doesn't change at once, you probably have a problem with your configuration file.

---

tv_GetActiveTool
PARSE result toolname others
IF CMP(toolname,"tv_penbrush") == 1
tv_Eraserbrush
tv_Paper Active 0
ELSE
IF CMP(toolname,"tv_eraserbrush") == 1
tv_Penbrush "toolmode"
tv_Paper Hardness 82 Invert 1 Size 0.701800 Angle 0.000000 OffsetX 0.000000 OffsetY 0.000000 FlipX 0 FlipY 0 Active 1 Name "/Paper 01"
END
END