Page 1 of 2

Zandronum PWO

Posted: Fri Dec 28, 2012 9:52 pm
by ZZYZX
Not sure if this is right subforum for such modifications, but it's best match.

Everyone who played ZDaemon or Odamex knows that Zandronum PWO is retarded. Now, here's a way to fix it!

I made a patch that enables you to set weapon priority by hand. Though ATM it only works for vanilla weapons and weapons that replace them (like WBSuperShotgun or WBShotgun) it's possible to add literally any weapon there.

Screenshots:
Image Image

When you pick up a weapon, a check is made whether that weapon is more or equal priority to currently selected; and if yes, then you are automatically switched to your new weapon.

Currently supported games are Doom, Heretic and Hexen. Strife is supported, but doesn't have any configuration files — I don't have it to test.

Download (Windows build): http://zzyzx.adminix.com.ua/zandronum.rar
Source code (a little desync with above build, contains only PWO stuff): https://bitbucket.org/CircuneiZ/zandronum-pwo/

Note that picking up weapons by PWO will still not work on servers that disable it with compatflags.

ALSO: This patch allows you to go singleplayer on Spak City servers. Woohoo!
ALSO #2: This patch allows you to cycle prev/next weapons using PWO. See weapprev_pwo and weapnext_pwo or their corresponding options in Controls menu.

RE: Zandronum PWO

Posted: Fri Dec 28, 2012 10:07 pm
by one_Two
Wow nice, I always find this a problem. Will your zandro exe show up as the normal thing when playing? I dunno how that works.

RE: Zandronum PWO

Posted: Fri Dec 28, 2012 10:10 pm
by ZZYZX
one_Two wrote: Wow nice, I always find this a problem. Will your zandro exe show up as the normal thing when playing? I dunno how that works.
Not sure what do you mean, but it should work OK with any Zandronum 1.0 server.

RE: Zandronum PWO

Posted: Fri Dec 28, 2012 10:13 pm
by Catastrophe
Thank you this is awesome

RE: Zandronum PWO

Posted: Fri Dec 28, 2012 10:16 pm
by HeX9109
Cool.

RE: Zandronum PWO

Posted: Fri Dec 28, 2012 10:21 pm
by ZZYZX
Update: made WBUILD skipping optional, controlled with CVar called cl_skipwbuild.

If you experience any problems while playing on Spak servers using this executable, type this in your console:

Code: Select all

cl_skipwbuild false

RE: Zandronum PWO

Posted: Fri Dec 28, 2012 11:31 pm
by Konar6
/me likes this

RE: Zandronum PWO

Posted: Sat Dec 29, 2012 12:30 am
by The Toxic Avenger
This is actually a really smart idea and I wouldn't mind seeing this in a future Zandro build.

RE: Zandronum PWO

Posted: Sat Dec 29, 2012 12:32 am
by Qent
If this were to get into Zandronum, I would like to have some way to use it with arbitrary DECORATE weapons.

RE: Zandronum PWO

Posted: Sat Dec 29, 2012 1:12 am
by ZZYZX
Three ways I see to add arbitrary weapons:
1. Parse DECORATE objects and get weapons that can be used from there (may cause unexpected bugs).
2. Add entries to DECORATE definition that control PWO behavior (Weapon.PWOName, Weapon.PWODefaultOrder).
3. Add new lump called ORDERDEF that contains definitions for weapons specific WAD adds, like following:

Code: Select all

[DoomDefault]
Game Doom
Weapon Fist "Fist" 0.1
...
Weapon SuperShotgun "Super Shotgun" 0.9
...
Weapon BFG9000 "BFG-9000" 0.7

[HereticDefault]
Game Heretic
...

[MyNewCoolMod]
Game Any
Weapon BFG2407 "BFG-2407" 1.0
And then combine this method with DECORATE parsing (for weapons that are undefined in PWO, but have SelectionOrder).

RE: Zandronum PWO

Posted: Sat Dec 29, 2012 1:36 am
by Catastrophe
Ultimate solution: Allow users to modify weapon priority in decorate without getting kicked off the server.

RE: Zandronum PWO

Posted: Sat Dec 29, 2012 10:29 pm
by ZZYZX
Update: moved all PWO-related definitions to ORDERDEF lump (or orderdef.txt in PK3 files).
Added Skulltag weapons.
Added ORDERDEF for vanilla weapons (also serves as an example of how to create such definitions).
Changed used CVars to follow PWO.<Game|Any>.<Weapon> template.

To add new weapons user may create a WAD or PK3 file with his own ORDERDEF that will either replace (if the lump begins with Clear directive) or add to existing info and put it into some autoload directory (I used skins/ in my build).

Replaced weapons will still use their parent PWO setting unless explicitly defined as new weapon.

Update #2: Moved source code to Bitbucket fork. PMed Torr about it.
Update #3: Added weapprev_pwo and weapnext_pwo (to switch to next/previous weapon by PWO, as you can guess). There's no way to set order of weapons that have equal priorities. Not recommended to use like that.

RE: Zandronum PWO

Posted: Sun Dec 30, 2012 11:28 am
by ZZYZX
Torr Samaho wrote:
Circunei Z wrote: If we make something like switchonpickup=3 option, then switchonpickup should be moved to PWO menu and PWO weapon cycling should be made independent of it (currently it will not work if cl_forcepwo is set to false).
Good point. I propose that we ask for feedback in your thread on how exactly to handle this.
Whether to add one more SwitchOnPickup value and move "Switch on pickup" option to PWO menu or leave it as it is (separate PWO variable that partially overrides SwitchOnPickup)?
Also, should "always-switch" compatflag that is commonly used on OS servers affect PWO weapon cycling?
Feedback please :)

P.S. I personally like SwitchOnPickup variant more — integration is good; and "always-switch" compatflag IMO should disable PWO weapon cycling because of it's purpose — to make weapon handling same as it was before Zandronum. If I will not have other opinions at some point it will be implemented like above.

RE: Zandronum PWO

Posted: Sun Dec 30, 2012 12:15 pm
by Torr Samaho
Thanks a lot for your patch! I look forward to integrate it once we have ironed out the last details (we already PMed to get the technical issues sorted out).

I personally also prefer to add switchonpickup=3 to let a player activate the PWO system. An important question though is whether switchonpickup may influence the weapon change behavior for anything not-pickup related. Shall we add a new option for this like use_pwo_on_weapn_switch?

RE: Zandronum PWO

Posted: Sun Dec 30, 2012 12:57 pm
by ZZYZX
Torr Samaho wrote:An important question though is whether switchonpickup may influence the weapon change behavior for anything not-pickup related. Shall we add a new option for this like use_pwo_on_weapn_switch?
I don't think any event other than weapon attach (pickup) should be processed by PWO; static SelectionOrder is enough for weapons that run out of ammo and maybe other possible cases I don't know about.

RE: Zandronum PWO

Posted: Sun Dec 30, 2012 1:31 pm
by Torr Samaho
In that case I'd say we should simply remove cl_forcepwo and activate the PWO controlled switch on pickup with "switchonpickup 3". EDIT: And the PWO menu option should be moved from the options menu to the weapon setup menu since switchonpickup is selected there.

RE: Zandronum PWO

Posted: Sun Dec 30, 2012 2:26 pm
by ZZYZX
Build update:
1. Merged PWO and generic weapon preferences.
2. Removed some obsolete [according to Torr] weapon settings.
3. Moved "Weapon preferences" menu out of "Player setup" into root Options menu.
5. Moved PWO setting from cl_forcepwo to switchonpickup==3

RE: Zandronum PWO

Posted: Sun Dec 30, 2012 2:55 pm
by Torr Samaho
Why did you move the weapon setup from the player settings menu to main options menu? I'd say everybody is used to find the weapon setup menu under the player settings since it's been there for at least half a decade.

RE: Zandronum PWO

Posted: Sun Dec 30, 2012 3:02 pm
by Zakken
Cool stuff.

RE: Zandronum PWO

Posted: Sun Dec 30, 2012 5:41 pm
by Catastrophe
Yeah keep it at the player setup page. Since, y'know it sets up your players PWO !!!