[SOLVED] [ACS] Achievement/reward system is borked

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

[SOLVED] [ACS] Achievement/reward system is borked

Postby MFG38 » Wed Jun 12, 2019 7:04 am

Over the past couple days, I've been trying to program a "feat" system in ACS for a gameplay mod I started developing the other day. Essentially, upon having killed a certain number of a specific enemy, the player would unlock an achievement of sorts and get a reward. For the sake of avoiding clutter in the script itself, it uses a switch/case structure, which admittedly may already be making it harder than it needs to be.

Anyway, I've made about a dozen different versions of the script at this point, but none of them seem to work. I even programmed in a rudimentary debugging system, and judging by the few tests I ran with it, the script that "tracks" the "achievements" never gets activated. I did manage to compile it without errors (after some time and effort), and it is being loaded by a LOADACS lump, but it just doesn't do anything. And I'm running out of ideas as to what I could be doing wrong.

See attached PK3 for the latest version of the system.
Attachments
featsys.pk3
(4.85 KiB) Downloaded 11 times
Last edited by MFG38 on Wed Jun 12, 2019 3:09 pm, edited 1 time in total.
User avatar
MFG38
 
Joined: 14 Apr 2019
Location: Finland
Operating System: Windows 10/8.1/8 64-bit

Re: [ACS] Achievement/reward system is borked

Postby Blue Shadow » Wed Jun 12, 2019 1:29 pm

You need to make sure the player and killed monster are running the scripts and functions they're meant to run. For example, it's the monster that calls PlayerNumber() function in the FeatChecker script, not the player.
User avatar
Blue Shadow
 
 
 
Joined: 14 Nov 2010
Operating System: Windows 10/8.1/8 64-bit
Graphics Processor: ATI/AMD (Modern GZDoom)

Re: [SOLVED] [ACS] Achievement/reward system is borked

Postby MFG38 » Wed Jun 12, 2019 3:11 pm

So I managed to make it work by editing the FeatTracker script slightly and making it loop in a weapon's Ready state. Might not be the cheapest method resource-wise, but it works, so whatever.
User avatar
MFG38
 
Joined: 14 Apr 2019
Location: Finland
Operating System: Windows 10/8.1/8 64-bit


Return to Scripting

Who is online

Users browsing this forum: No registered users and 2 guests