Jump to content

How do I check if the player is in slow motion (weapon wheel or dead eye)?


HughJanus
 Share

Recommended Posts

While in slow motion, the physics go apesh*t and a force push of 50 suddenly equals a force push of 500 or so.

I need to check wheter the time is running correctly or dead eye or the weapon wheel or some other time modifying feature is used.

Is there a simple way to do that (with natives preferably)?

Link to comment
Share on other sites

If there is no native you might be able to estimate it by using the game time vs real time. It is obviously not perfect, but might help in most cases.

Link to comment
Share on other sites

The script refreshes every millisecond (because it creates actions which happen every 10 milliseconds or even more often, depending on chance), so I would need to know the time scale every millisecond and cant afford to wait a second to compare how fast time goes by.

Or did you mean it in another way?

Link to comment
Share on other sites

I did mean it that way, but you could maybe see if after 10 real life milliseconds the gametimer has not increased as much. I don't recall exactly how it works, but it might be sufficient.

Link to comment
Share on other sites

On 3/27/2020 at 6:03 PM, LMS said:

I did mean it that way, but you could maybe see if after 10 real life milliseconds the gametimer has not increased as much. I don't recall exactly how it works, but it might be sufficient.

 

Could you lend me a hand and point a finger to the corresponding natives, please?

Is the game timer the game clock? Does the game timer run slower when in deadeye or only the clock?

Link to comment
Share on other sites

Try using GET_GAME_TIMER to measure how much time has elapsed in game-time. It should operate in milliseconds. If you then measure the same time using system-time (e.g. using the Windows API), it might allow you to tell whether it is running slower than expected.

 

Link to comment
Share on other sites

Hm, I use the game timer already for my functions which apply forces. I thought that the game clock and game timer were two different values.

I thought the cause of the weird behavior was that e.g. the game clock ticked 1 second (in slow motion) while the game timer ticked 3 seconds and thus applied 3 times the force in this 1 second of game time.

Link to comment
Share on other sites

They are different values, but the game clock is the "world time", e.g. 6 pm in the game. Game timer is the time in milliseconds since that game itself has started and it scales with the timescale. So when you set the time scale to 0.1, the game timer no longer match real-time milliseconds, but 1/10 of that.

  • Like 1
Link to comment
Share on other sites

Thanks for the clarification.

Then I have another problem now - I dont know the root of the weird behavior anymore^^

Because I do all my stuff based on the game timer. If the game timer slows down with the game clock, why is more force being applied during slow motion?

Link to comment
Share on other sites

7 hours ago, HughJanus said:

Thanks for the clarification.

Then I have another problem now - I dont know the root of the weird behavior anymore^^

Because I do all my stuff based on the game timer. If the game timer slows down with the game clock, why is more force being applied during slow motion?

 

You can try multiplying the force with the games time scale, to have some consistency.

Link to comment
Share on other sites

13 minutes ago, Daylight848 said:

 

You can try multiplying the force with the games time scale, to have some consistency.

 

I was rather thinking about a solution like: if (timescale = 1.0) apply force

But I havent found a timescale native yet.

Actually it is like this:

cur = get game timer

tar = cur + amount of time the force shall be applied

while (game timer < tar) apply force

 

With this code, peds fly around like crazy while in weapon wheel or dead eye :D

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...