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

Projects that alter game functions but do not include new maps belong here.
Forum rules
The Projects forums are ONLY for YOUR PROJECTS! If you are asking questions about a project, either find that project's thread, or start a thread in the General section instead.

Got a cool project idea but nothing else? Put it in the project ideas thread instead!

Projects for any Doom-based engine (especially 3DGE) are perfectly acceptable here too.

Please read the full rules for more details.

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

Postby EtherBot » Sat Jun 06, 2020 5:11 am

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
EtherBot
 
Joined: 05 May 2017

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

Postby spectrefps » Thu Jul 09, 2020 12:29 pm

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
spectrefps
 
Joined: 21 Jun 2020
Operating System: Windows 10/8.1/8/201x 64-bit

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

Postby XASSASSINX » Sat Jul 18, 2020 4:13 pm

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.
XASSASSINX
 
Joined: 20 Dec 2016
Location: MURICAA BROTHER! Just kidding, Brazil.

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

Postby Enjay » Sun Aug 09, 2020 4:36 am

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.
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

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

Postby Jarewill » Sun Aug 09, 2020 4:50 am

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:
You do not have the required permissions to view the files attached to this post.
Jarewill
 
 
 
Joined: 21 Jul 2019

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

Postby Enjay » Sun Aug 09, 2020 5:45 am

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]
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

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

Postby Enjay » Mon Aug 10, 2020 3:41 am

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?
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

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

Postby phantombeta » Mon Aug 10, 2020 4:21 am

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);
User avatar
phantombeta
In the meadow of sinful thoughts, every flower's a perfect one
 
Joined: 02 May 2013
Location: Brazil, South America, Earth, Orion-Cygnus Arm, Milky Way
Discord: phantombeta#2461
Twitch ID: phantombeta_
Github ID: Doom2fan
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

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

Postby Enjay » Mon Aug 10, 2020 4:42 am

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. :)
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

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

Postby Mini--Joe » Fri Aug 21, 2020 12:07 am



Got a fix for this?
User avatar
Mini--Joe
 
Joined: 27 Jul 2014

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

Postby NightFright » Thu Sep 17, 2020 7:44 am

I was wondering if this might possibly be used as a base to replicate the weapon wheel from the Unity release on Steam.
User avatar
NightFright
Spotlight Team
 
Joined: 02 May 2008
Location: Germany

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

Postby slyrboi » Fri Sep 18, 2020 7:29 am

Mini--Joe wrote:

Got a fix for this?


Same, i've also encountered it in specific cases
slyrboi
 
Joined: 01 Mar 2019

Previous

Return to Gameplay Mods

Who is online

Users browsing this forum: Dr_Cosmobyte, Ferretmanjcdenton, Funky Gnoll and 11 guests