seems triggers applied from a scheduled function do not stay true upon any input

There are no stupid questions, just stupid answers.
6 posts Page 1 of 1
Sir_Skurpsalot
Posts: 55
Joined: Tue Jan 28, 2020 6:32 pm
by Sir_Skurpsalot » Mon Apr 06, 2020 11:45 pm
Continuing on from my previous post, It seems that any trigger that is set on a weapon image that is called from a scheduled function does not stay applied upon input. What I mean is that I have a function that is shooting a raycast at regular intervals, making use of a schedule. When it hits a "friendly" it sets genericTrigger3 on the weapon image in slot 0 to true. If I stay looking at this object and touch any movement key the trigger sets itself to false. For debugging purposes I have removed anything from this function that returns the trigger to false, and it still happens. I tried using different genericTriggers and also setImageTarget instead and they all behave the same. If I write a simple function to toggle the generic trigger on and off with the press of a key it works fine as intended. There is something about the fact that it was called from a scheduled function that I think is making it not stay applied.
fLUnKnhaXYU
Posts: 164
Joined: Wed Nov 15, 2017 8:19 am
by fLUnKnhaXYU » Tue Apr 07, 2020 2:05 am
Sry I dont have any advice . Id like to ask you , what does setting generictrigger3 to true accomplish ? What is what is your desired effect here ?
Sir_Skurpsalot
Posts: 55
Joined: Tue Jan 28, 2020 6:32 pm
by Sir_Skurpsalot » Tue Apr 07, 2020 3:04 am
The intended outcome of all this is to have it when a teammate crosses your line of sight within a certain distance it triggers a transition to a weapon state where it shows your character taking their muzzle offline so as to not flag them. I'm using setImageGenericTrigger(0,3,true) to accomplish the transition. It would work if it would just not get set to false as soon as you press a key. Even just pressing shift causes it to break. It's really strange.
fLUnKnhaXYU
Posts: 164
Joined: Wed Nov 15, 2017 8:19 am
by fLUnKnhaXYU » Tue Apr 07, 2020 8:10 am
Are you familiar with the speed-o-meter hud ? If not then you should search for the code used for the speedometer hud schedule . perhaps someone can help you find it or can post a nice example of the speedometer scheduling code .
Sir_Skurpsalot
Posts: 55
Joined: Tue Jan 28, 2020 6:32 pm
by Sir_Skurpsalot » Tue Apr 07, 2020 1:31 pm
Fixed it. If I have the raycast scanning function that is looping on a schedule call an outside serverCmd function that sets the imageGenericTrigger, it works like a charm.
Jason Campbell
Posts: 360
Joined: Fri Feb 13, 2015 2:51 am
 
by Jason Campbell » Tue Apr 07, 2020 7:53 pm
Nice. Love that feeling when you finally figure it out (and it doesn't break something else!)
6 posts Page 1 of 1

Who is online

Users browsing this forum: No registered users and 4 guests