Posted June 22, 20204 yr Anyone have experienced a issue with scriptHookRDRDotNet where the draw_text method results in a blinking text like if there was a Wait() being called somewhere? I have this issue only in .net code, in .asi works fine. Also, if i reload scripts like 10 times, the bug disappears and text starts to appear as expected. This is the actual code that is called in a Tick Native.Function.Call(Native.Hash.SET_TEXT_SCALE, 0.0, scale) Native.Function.Call(Native.Hash._SET_TEXT_COLOR, col.R, col.G, col.B, col.A) Native.Function.Call(Native.Hash.SET_TEXT_CENTRE, bCentered) If bDropShadow Then Native.Function.Call(Native.Hash.SET_TEXT_DROPSHADOW, 1, 1, 1, 1, 1) Else Native.Function.Call(Native.Hash.SET_TEXT_DROPSHADOW, 0, 0, 0, 0, 0) End If '15533817421857667793UL = _DRAW_TEXT Native.Function.Call(15533817421857667793UL, Native.Function.Call(Of String)(Native.Hash._CREATE_VAR_STRING, 10, "LITERAL_STRING", sText), x, y)
June 22, 20204 yr I think you have to use WAIT(0) or WAIT(1) or some low value. I once tried WAIT(500) and my texts were blinking to. Guess it has to do with the "refreshing" of the script.
June 22, 20204 yr Author the problem is that im not calling any Wait() in the tick, so, there is no pause, just the normal script interval, and the issue disappears after some script reloads, very odd
June 23, 20204 yr You could try measuring the tick time and see if it perhaps skips a tick (maybe WAIT is not implemented correctly).
July 1, 20204 yr Author On 6/23/2020 at 3:37 PM, LMS said: You could try measuring the tick time and see if it perhaps skips a tick (maybe WAIT is not implemented correctly). about the WAIT implementation, this is what we have in ScripthookV RDR DotNet plugin: while (true) { // Yield execution and give it back to ScriptHookRDR2. scriptWait(0); // Switch to our CLR fiber and wait for it to switch back. SwitchToFiber(sScriptFiber); } this method "scriptWait" is imported from scripthookRDR: IMPORT void scriptWait(DWORD time); its very odd this issue, if we disable VSync the blinking is even more visible, more fps, other methods like DRAW_RECT works perfect
July 5, 20204 yr If DRAW_RECT works fine, then I guess it is not the waiting behavior. Perhaps the text buffer is messed up/mismanaged and gets cleared by accident sometimes?
July 6, 20204 yr Author thats the actual code: Native.Function.Call(Native.Hash.SET_TEXT_SCALE, 0.0, scale) Native.Function.Call(Native.Hash._SET_TEXT_COLOR, col.R, col.G, col.B, col.A) Native.Function.Call(Native.Hash.SET_TEXT_CENTRE, bCentered) If bDropShadow Then Native.Function.Call(Native.Hash.SET_TEXT_DROPSHADOW, 1, 1, 1, 1, 1) Else Native.Function.Call(Native.Hash.SET_TEXT_DROPSHADOW, 0, 0, 0, 0, 0) End If '15533817421857667793UL the draw text method: Native.Function.Call(15533817421857667793UL, Native.Function.Call(Of String)(Native.Hash._CREATE_VAR_STRING, 10, "LITERAL_STRING", sText), x, y)
July 8, 20204 yr It looks fine to me, but I was thinking perhaps the Script Hook mismanages the translation from a managed string to unmanaged and the buffer then gets cleared somewhere accidentally. But I have never used that Script Hook so I cannot say why exactly it would not work for text but works for rect.
July 8, 20204 yr Author yeah, its a odd issue, i also noticed that if i bring the SNT menu (the trainer that comes with scripthookRDR by AB) and then close it, the blinking is reduced, seems that im missing to call something somewhere lol
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.