Created
October 6, 2021 21:55
-
-
Save csiki/aa344f7c119e216580c8c5d2d3a916ab to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "zcommon.acs" | |
#define KILL_REWARD 100.0 | |
#define EXIT_REWARD 500.0 | |
// these variables are exposed to ViZDoom | |
global int 0:reward; | |
global int 1:killCount; // number of monsters killed | |
global int 2:xpos; // player's position | |
global int 3:ypos; | |
script 1 (void) | |
{ // monster Killed | |
killCount += 1.0; | |
reward += KILL_REWARD; | |
} | |
script 2 OPEN | |
{ // episode start | |
ClearInventory(); // remove pistol | |
GiveInventory("Shotgun", 1); | |
GiveInventory("Shell", 50); | |
} | |
script 5 ENTER | |
{ // track user's position | |
while (1) | |
{ | |
xpos = GetActorX(0); | |
ypos = GetActorY(0); | |
Print(f:GetActorX(0), s:", ", f:GetActorY(0)); | |
delay(1); | |
} | |
} | |
script 3 (void) | |
{ // hitting the exit button | |
reward += EXIT_REWARD; | |
Exit_Normal(0); | |
} | |
script 4 DEATH | |
{ // death | |
reward -= EXIT_REWARD; | |
Exit_Normal(0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment