Page 2 of 2

Re: [ZScript] Lazy Points: basic scoring system

Posted: Thu Feb 18, 2021 7:49 am
by m8f
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.

Re: [ZScript] Lazy Points: basic scoring system

Posted: Thu Feb 18, 2021 10:47 am
by YeeTee2
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

Re: [ZScript] Lazy Points: basic scoring system

Posted: Thu Feb 18, 2021 10:59 am
by m8f
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.

Re: [ZScript] Lazy Points: basic scoring system

Posted: Thu Feb 18, 2021 11:20 am
by YeeTee2
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

Re: [ZScript] Lazy Points: basic scoring system

Posted: Thu Feb 18, 2021 11:27 am
by m8f
Easy, dirty way: go to zscript/zc_HealthBonus.zs file and replace the body of getMultiplier() function with just

Code: Select all

return 1.0;
Difficult, clean way: remove zc_HealthBonus.zs file and remove any references to zc_HealthBonus class from other classes.

Re: [ZScript] Lazy Points: basic scoring system

Posted: Thu Feb 18, 2021 11:32 am
by YeeTee2
So, I simply replace

Code: Select all

  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?

Re: [ZScript] Lazy Points: basic scoring system

Posted: Thu Feb 18, 2021 12:12 pm
by m8f
So it looks like this:

Code: Select all

  double getMultiplier()
  {
    return 1.0;
  }