Page 4 of 5

Re: [WIP] PyWeaponWheel v0.3 - Universal weapon wheel!

PostPosted: Sat Jun 06, 2020 5:11 am
by EtherBot
One thing that sort of troubles me is that it requires freelook to be enabled to work properly. I tried looking into a way to bind my wheel key to turn freelook on but i cant seem to find a way to make it turn off freelook when releasing that key. Wish there was an easier method for this as I generally prefer turning off freelook for doom

Re: [WIP] PyWeaponWheel v0.3 - Universal weapon wheel!

PostPosted: Thu Jul 09, 2020 12:29 pm
by spectrefps
This is a great mod. Love the fact that it also (optionally) freezes everything while you have it up, so you can switch weapons during fast paced encounters. However, as others have stated, it has a serious bug with Doom RL Arsenal (DRLA). After some time, the key to drop weapons will cease to function, preventing the player from dropping any weapons (or picking up any new ones). At first I thought this was due to hitting the weapon-drop key (in my case, backspace) while the weapon wheel was up. But, as was previously mentioned by another user, it can happen even without hitting the drop-weapon key. Otherwise, it is a wonderful mod, and I hope you are able to fix this issue so I can continue using it in DRLA! :D

Re: [WIP] PyWeaponWheel v0.3 - Universal weapon wheel!

PostPosted: Sat Jul 18, 2020 4:13 pm
by XASSASSINX
Hello! I have a suggestion that would work very well with mods that have A TON of weapons. Currently, if you try to play with a mod that has alot of weapons, the wheel looks like this: https://imgur.com/a/jHgAq18

Now, This is a complete clusterfuck and i'm sure not many people play with such randomspawners that add THIS many weapons, but even then, i've seen alot of mods where this happens. My fix is really simple, you know in GTA V when you select a weapon from the wheel but you have various types of it? Like shotguns or sub-machineguns? You scroll that weapon type until you find the one you want to change to, correct? This is the "fix". A Cvar or menu option where you would be able to "scroll" (using mousewheel by default) trhough a weapon slot, the order could be (default) weapon selection order. It is really simple and would look neat.

Re: [WIP] PyWeaponWheel v0.3 - Universal weapon wheel!

PostPosted: Sun Aug 09, 2020 4:36 am
by Enjay
Quite a few people have obviously looked at this mod and made their own versions of it. So I'm wondering if anyone has managed to address the various floating point truncation warnings that appear at the console during loading when developer mode is active?

Code: Select allExpand view
LoadActors: Load actor definitions.
Script warning, "PyWeaponWheel_v0.3.pk3:zscript/pyw/ev_core.zsc" line 60:
Truncation of floating point value
Script warning, "PyWeaponWheel_v0.3.pk3:zscript/pyw/ev_core.zsc" line 597:
Truncation of floating point value
Script warning, "PyWeaponWheel_v0.3.pk3:zscript/pyw/ev_core.zsc" line 697:
Truncation of floating point value
Script warning, "PyWeaponWheel_v0.3.pk3:zscript/pyw/ev_core.zsc" line 697:
Truncation of floating point value
Script warning, "PyWeaponWheel_v0.3.pk3:zscript/pyw/ev_core.zsc" line 699:
Truncation of floating point value
Script warning, "PyWeaponWheel_v0.3.pk3:zscript/pyw/ev_core.zsc" line 699:
Truncation of floating point value
Script warning, "PyWeaponWheel_v0.3.pk3:zscript/pyw/ev_core.zsc" line 704:
Truncation of floating point value
Script warning, "PyWeaponWheel_v0.3.pk3:zscript/pyw/ev_core.zsc" line 704:
Truncation of floating point value
Script warning, "PyWeaponWheel_v0.3.pk3:zscript/pyw/ev_core.zsc" line 706:
Truncation of floating point value
Script warning, "PyWeaponWheel_v0.3.pk3:zscript/pyw/ev_core.zsc" line 706:
Truncation of floating point value
Script warning, "PyWeaponWheel_v0.3.pk3:zscript/pyw/ev_core.zsc" line 710:
Truncation of floating point value
Script warning, "PyWeaponWheel_v0.3.pk3:zscript/pyw/ev_core.zsc" line 710:
Truncation of floating point value
Script warning, "PyWeaponWheel_v0.3.pk3:zscript/pyw/ev_core.zsc" line 715:
Truncation of floating point value
Script warning, "PyWeaponWheel_v0.3.pk3:zscript/pyw/ev_core.zsc" line 823:
Truncation of floating point value
Script warning, "PyWeaponWheel_v0.3.pk3:zscript/pyw/ev_core.zsc" line 823:
Truncation of floating point value
Script warning, "PyWeaponWheel_v0.3.pk3:zscript/pyw/ev_core.zsc" line 830:
Truncation of floating point value
Script warning, "PyWeaponWheel_v0.3.pk3:zscript/pyw/ev_core.zsc" line 831:
Truncation of floating point value
Script warning, "PyWeaponWheel_v0.3.pk3:zscript/pyw/ev_drawer.zsc" line 31:
Truncation of floating point value
Script warning, "PyWeaponWheel_v0.3.pk3:zscript/pyw/ev_drawer.zsc" line 32:
Truncation of floating point value
script parsing took 197.57 ms


If not, is anyone able to take a look. I tried but I got lost very quickly and wasn't able to resolve anything.

Re: [WIP] PyWeaponWheel v0.3 - Universal weapon wheel!

PostPosted: Sun Aug 09, 2020 4:50 am
by Jarewill
Enjay wrote:Quite a few people have obviously looked at this mod and made their own versions of it. So I'm wondering if anyone has managed to address the various floating point truncation warnings that appear at the console during loading when developer mode is active?
If not, is anyone able to take a look. I tried but I got lost very quickly and wasn't able to resolve anything.

Here you go Enjay.
I guess I'm not the only one getting annoyed whenever any warning pop up during loading and never disable developer mode. :lol:

Re: [WIP] PyWeaponWheel v0.3 - Universal weapon wheel!

PostPosted: Sun Aug 09, 2020 5:45 am
by Enjay
Beautiful! Works like a charm. Thank you very much. :thumb:

[edit]and now that I've played around with it a bit, I can see that it's going to be something that I use quite a lot with some mods. The warnings had bothered me to the point of not wanting to use the wheel (even though functionally it was still good). This adds the final bit of polish to it as far as I'm concerned.

I had a look at the fixes and I can follow what was done, but there is no way I could have arrived at them myself. Once again, thank you.[/edit]

Re: [WIP] PyWeaponWheel v0.3 - Universal weapon wheel!

PostPosted: Mon Aug 10, 2020 3:41 am
by Enjay
Hmmm...

I thought I'd have a look to see what happens if I tell GZDoom that the weapon wheel is versioned to the current zscript and there are a lot of deprecation warnings.

Spoiler:


I *think* I have addressed most of them using the deprecation warnings.

I replaced all instances of CharCodeAt with ByteAt() and that seems to be working.
I replaced all instances of CharAt with Mid(). Honestly, I wasn't sure whether to use Left or Mid, but Mid seems to be working.
I replaced all instances of frozen with Level.isFrozen() and that also seems to be working - with one exception (noted below).
I replaced all instances of S_Sound with S_StartSound and that too seems to be working.

So, question number 1, are those replacements all suitable? The wiki seems to be a bit thin on exactly how some of these are meant to work. They seem to be working but there could easily be some functionality that I have missed or don't recognise as not working correctly.

For example, is it OK to replace:
Code: Select allExpand view
if(level.frozen)

with:
Code: Select allExpand view
if(Level.isFrozen())

(the extra brackets make me wonder if it's OK, but if they are missing, I get an error: "Function 'isFrozen' used without ().")

Question number 2 relates to line 635 in ev_core.zsc. Specifically, this error.
Code: Select allExpand view
Script warning, "PyWeaponWheel_TrancFix.pk3:zscript/pyw/ev_core.zsc" line 635:
Accessing deprecated member variable frozen - deprecated since 3.8.0, Use Level.isFrozen() instead

The line is:
Code: Select allExpand view
Level.frozen = wheelIsOpen;//&&level.maptime%3!=0;

if I change that to:
Code: Select allExpand view
Level.isFrozen() = wheelIsOpen;//&&level.maptime%3!=0;

I get
Code: Select allExpand view
Script error, "PyWeaponWheel_TrancFix.pk3:zscript/pyw/ev_core.zsc" line 635:
Expression must be a modifiable value

If I miss off the () after Level.isFrozen I get told that the () is needed: "Function 'isFrozen' used without ()."

So, I'm not sure what to do there and it is now the only warning on start up so I'd like to get it sorted. Any ideas?

Re: [WIP] PyWeaponWheel v0.3 - Universal weapon wheel!

PostPosted: Mon Aug 10, 2020 4:21 am
by phantombeta
Enjay wrote:I *think* I have addressed most of them using the deprecation warnings.

I replaced all instances of CharCodeAt with ByteAt() and that seems to be working.
I replaced all instances of CharAt with Mid(). Honestly, I wasn't sure whether to use Left or Mid, but Mid seems to be working.
I replaced all instances of frozen with Level.isFrozen() and that also seems to be working - with one exception (noted below).
I replaced all instances of S_Sound with S_StartSound and that too seems to be working.

So, question number 1, are those replacements all suitable? The wiki seems to be a bit thin on exactly how some of these are meant to work. They seem to be working but there could easily be some functionality that I have missed or don't recognise as not working correctly.

Those are mostly right. However, what you replace CharCodeAt and CharAt depends on the contents of the string.
If it's pretty much guaranteed to be ASCII-only (e.g., class names), it's safe to use "ByteAt (index)" and "Mid (index, 1)", respectively. If the text can contain Unicode characters (e.g., tags, cluster texts), however, then you need to iterate over the string manually with CodePointCount and GetNextCodePoint for the text to be handled correctly.

For example, is it OK to replace:
Code: Select allExpand view
if(level.frozen)

with:
Code: Select allExpand view
if(Level.isFrozen())

(the extra brackets make me wonder if it's OK, but if they are missing, I get an error: "Function 'isFrozen' used without ().")

Thata's correct. "frozen" is a variable while "isFrozen" is a function, so the parentheses do need to be added there for it to work.

Question number 2 relates to line 635 in ev_core.zsc. Specifically, this error.
Code: Select allExpand view
Script warning, "PyWeaponWheel_TrancFix.pk3:zscript/pyw/ev_core.zsc" line 635:
Accessing deprecated member variable frozen - deprecated since 3.8.0, Use Level.isFrozen() instead

The line is:
Code: Select allExpand view
Level.frozen = wheelIsOpen;//&&level.maptime%3!=0;

if I change that to:
Code: Select allExpand view
Level.isFrozen() = wheelIsOpen;//&&level.maptime%3!=0;

I get
Code: Select allExpand view
Script error, "PyWeaponWheel_TrancFix.pk3:zscript/pyw/ev_core.zsc" line 635:
Expression must be a modifiable value

If I miss off the () after Level.isFrozen I get told that the () is needed: "Function 'isFrozen' used without ()."

So, I'm not sure what to do there and it is now the only warning on start up so I'd like to get it sorted. Any ideas?

In this specific case, it needs to be replaced with level.setFrozen instead. Like so:
Code: Select allExpand view
Level.setFrozen (wheelIsOpen);

Re: [WIP] PyWeaponWheel v0.3 - Universal weapon wheel!

PostPosted: Mon Aug 10, 2020 4:42 am
by Enjay
Thank you kindly. The "Level.setFrozen" did the job. All warnings are now gone.

I'll look through all my other changes as well to try and check against the information that you provided.

Thanks again. :)

Re: [WIP] PyWeaponWheel v0.3 - Universal weapon wheel!

PostPosted: Fri Aug 21, 2020 12:07 am
by Mini--Joe


Got a fix for this?

Re: [WIP] PyWeaponWheel v0.3 - Universal weapon wheel!

PostPosted: Thu Sep 17, 2020 7:44 am
by NightFright
I was wondering if this might possibly be used as a base to replicate the weapon wheel from the Unity release on Steam.

Re: [WIP] PyWeaponWheel v0.3 - Universal weapon wheel!

PostPosted: Fri Sep 18, 2020 7:29 am
by slyrboi
Mini--Joe wrote:

Got a fix for this?


Same, i've also encountered it in specific cases

Re: [WIP] PyWeaponWheel v0.3 - Universal weapon wheel!

PostPosted: Wed Sep 23, 2020 10:01 pm
by SiMpLeToNiUm
Can i_timescale be used with this mod to simulate the slowdown effect from NuDoom instead of freezing?

Re: [WIP] PyWeaponWheel v0.3 - Universal weapon wheel!

PostPosted: Wed Sep 23, 2020 11:57 pm
by wildweasel
SiMpLeToNiUm wrote:Can i_timescale be used with this mod to simulate the slowdown effect from NuDoom instead of freezing?

i_timescale can't be changed by mods right now; there's a lot of stuff that is tied to it that would not behave correctly, such as input handling.

Re: [WIP] PyWeaponWheel v0.3 - Universal weapon wheel!

PostPosted: Thu Sep 24, 2020 12:07 am
by SiMpLeToNiUm
Darn. And I imagine there's not much else that would do something similar?