[ZScript] Lazy Points: basic scoring system

Post your example zscripts/ACS scripts/etc here.
Forum rules
The Projects forums are only for 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.
User avatar
m8f
 
 
Posts: 1446
Joined: Fri Dec 29, 2017 4:15 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Manjaro Linux
Location: Siberia (UTC+7)

Re: [ZScript] Lazy Points: basic scoring system

Post 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.
YeeTee2
Posts: 29
Joined: Sun Feb 07, 2021 1:36 pm

Re: [ZScript] Lazy Points: basic scoring system

Post 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
User avatar
m8f
 
 
Posts: 1446
Joined: Fri Dec 29, 2017 4:15 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Manjaro Linux
Location: Siberia (UTC+7)

Re: [ZScript] Lazy Points: basic scoring system

Post 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.
YeeTee2
Posts: 29
Joined: Sun Feb 07, 2021 1:36 pm

Re: [ZScript] Lazy Points: basic scoring system

Post 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
User avatar
m8f
 
 
Posts: 1446
Joined: Fri Dec 29, 2017 4:15 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Manjaro Linux
Location: Siberia (UTC+7)

Re: [ZScript] Lazy Points: basic scoring system

Post 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.
YeeTee2
Posts: 29
Joined: Sun Feb 07, 2021 1:36 pm

Re: [ZScript] Lazy Points: basic scoring system

Post 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?
User avatar
m8f
 
 
Posts: 1446
Joined: Fri Dec 29, 2017 4:15 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Manjaro Linux
Location: Siberia (UTC+7)

Re: [ZScript] Lazy Points: basic scoring system

Post by m8f »

So it looks like this:

Code: Select all

  double getMultiplier()
  {
    return 1.0;
  }

Return to “Script Library”