[ZScript] Lazy Points: basic scoring system

Post your example zscripts/ACS scripts/etc here.

Re: [ZScript] Lazy Points: basic scoring system

Postby m8f » Thu Feb 18, 2021 7:49 am

Copy-past, mostly.

1. Copy zscript directory to your mod. If your mod already has zscript directory, move the contents of my zscript into your zscript. If you want the code to be extra tidy, put Lazy Points code into a subdirectory.
2. Rename zscript files so they have your unique prefix instead of zc_. Putting files into a different directory also works. This is to ensure that file paths are unique and won't clash with other mods.
3. Inside zscript files, rename all classes so they have your unique prefix instead of zc_. Find and Replace heavily recommended. This is also so classes won't cause conflicts with other mods.
4. Create top-level zscript lump where you define version and include all files from point 2.
5. Copy the contents of cvarinfo.txt to your cvarinfo lump. If you don't have one, create, or just copy the whole lump.
6. Inside cvarinfo, rename cvars so they have your unique prefix instead of lp_. Again, to prevent conflicts. Search for renamed cvars in ZScript files and rename them there too.
7. The same for keyconf.txt.
8. mapinfo.txt - if you don't have one, just copy mine, changing prefixes for classes there for yours from point 3. If you have mapinfo lump, add classes from AddEventHandlers there.
9. menudef.txt - again, copy contents or lump with changing prefixes.
10. Copy copying.txt to your mod - technically, not required, but it's a license for Lazy Points.
User avatar
m8f
dreamer
 
 
 
Joined: 29 Dec 2017
Location: Siberia (UTC+7)
Discord: m8f#0629
Github ID: mmaulwurff
Operating System: Debian-like Linux (Debian, Ubuntu, Kali, Mint, etc) 64-bit

Re: [ZScript] Lazy Points: basic scoring system

Postby YeeTee2 » Thu Feb 18, 2021 10:47 am

m8f wrote:Copy-past, mostly.

1. Copy zscript directory to your mod. If your mod already has zscript directory, move the contents of my zscript into your zscript. If you want the code to be extra tidy, put Lazy Points code into a subdirectory.
2. Rename zscript files so they have your unique prefix instead of zc_. Putting files into a different directory also works. This is to ensure that file paths are unique and won't clash with other mods.
3. Inside zscript files, rename all classes so they have your unique prefix instead of zc_. Find and Replace heavily recommended. This is also so classes won't cause conflicts with other mods.
4. Create top-level zscript lump where you define version and include all files from point 2.
5. Copy the contents of cvarinfo.txt to your cvarinfo lump. If you don't have one, create, or just copy the whole lump.
6. Inside cvarinfo, rename cvars so they have your unique prefix instead of lp_. Again, to prevent conflicts. Search for renamed cvars in ZScript files and rename them there too.
7. The same for keyconf.txt.
8. mapinfo.txt - if you don't have one, just copy mine, changing prefixes for classes there for yours from point 3. If you have mapinfo lump, add classes from AddEventHandlers there.
9. menudef.txt - again, copy contents or lump with changing prefixes.
10. Copy copying.txt to your mod - technically, not required, but it's a license for Lazy Points.


https://gofile.io/d/Mred79
I managed to get it working, but it constantly has x2.0
YeeTee2
 
Joined: 07 Feb 2021

Re: [ZScript] Lazy Points: basic scoring system

Postby m8f » Thu Feb 18, 2021 10:59 am

Even when you health lowers?
in the OP, I wrote:Scoring:
...
8. Player with 50% and more health gets kill points (with chain kill bonus) multiplied by 1.5, with 100% and more - by 2.
User avatar
m8f
dreamer
 
 
 
Joined: 29 Dec 2017
Location: Siberia (UTC+7)
Discord: m8f#0629
Github ID: mmaulwurff
Operating System: Debian-like Linux (Debian, Ubuntu, Kali, Mint, etc) 64-bit

Re: [ZScript] Lazy Points: basic scoring system

Postby YeeTee2 » Thu Feb 18, 2021 11:20 am

m8f wrote:Even when you health lowers?
in the OP, I wrote:Scoring:
...
8. Player with 50% and more health gets kill points (with chain kill bonus) multiplied by 1.5, with 100% and more - by 2.


No, not when health lowers, I didn't read that bit. Is there a way to remove it? I don't think it fits with my thing that well
YeeTee2
 
Joined: 07 Feb 2021

Re: [ZScript] Lazy Points: basic scoring system

Postby m8f » Thu Feb 18, 2021 11:27 am

Easy, dirty way: go to zscript/zc_HealthBonus.zs file and replace the body of getMultiplier() function with just
Code: Select allExpand view
return 1.0;
Difficult, clean way: remove zc_HealthBonus.zs file and remove any references to zc_HealthBonus class from other classes.
User avatar
m8f
dreamer
 
 
 
Joined: 29 Dec 2017
Location: Siberia (UTC+7)
Discord: m8f#0629
Github ID: mmaulwurff
Operating System: Debian-like Linux (Debian, Ubuntu, Kali, Mint, etc) 64-bit

Re: [ZScript] Lazy Points: basic scoring system

Postby YeeTee2 » Thu Feb 18, 2021 11:32 am

So, I simply replace
Code: Select allExpand view
  double getMultiplier()
  {
    int healthPercent = _player.health * 100 / _player.mo.GetMaxHealth();

    if      (healthPercent >= 100) return 2.0;
    else if (healthPercent >=  50) return 1.5;

    return 1.0;
  }

with what you said?
YeeTee2
 
Joined: 07 Feb 2021

Re: [ZScript] Lazy Points: basic scoring system

Postby m8f » Thu Feb 18, 2021 12:12 pm

So it looks like this:
Code: Select allExpand view
  double getMultiplier()
  {
    return 1.0;
  }
User avatar
m8f
dreamer
 
 
 
Joined: 29 Dec 2017
Location: Siberia (UTC+7)
Discord: m8f#0629
Github ID: mmaulwurff
Operating System: Debian-like Linux (Debian, Ubuntu, Kali, Mint, etc) 64-bit

Previous

Return to Script Library

Who is online

Users browsing this forum: No registered users and 0 guests