Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
TimeOfDeath

zdoom editing: new question: timer?

Recommended Posts

#include "zcommon.acs"

script 1 open
{acs_execute(2,0,0,0,0);}

script 2 (void)
{clearinventory();
giveinventory("chainsaw",1);
setactorproperty(0,APROP_health,50);}
How do I make setactorproperty work with an open script? I can make it work when the player activates the script, but not immediately when the map starts. It's for a single player wad and I want to set the player's health at the start of every map.

Share this post


Link to post

I only messed with it a little bit but this seemed to work (enter instead of open, read yellow box here: http://zdoom.org/wiki/Script_types ):

#include "zcommon.acs"

script 2 enter
{clearinventory();
giveinventory("chainsaw",1);
setactorproperty(0,APROP_health,50);}

Share this post


Link to post

New question: is it possible to keep track of the total time (including the time spent on incomplete attempts) over the course of many maps?

Say there are 100 maps, you start on map01 and the time starts, but if you die on map25 then the total timer restarts (the time on the bottom of the intermission screen). How do you keep track of the total time if you die? (of all attempts, not only the completed map attempts)

Share this post


Link to post
TimeOfDeath said:

New question: is it possible to keep track of the total time, including deaths, over the course of many maps?

I'm not sure about the total time problem, but if you want to keep track of the total deaths, I guess you can use a global scope, for example:

#include "zcommon.acs"

global int 1:deathcount;

script 32 DEATH
{
deathcount++;
}
You can read more about it in:
http://zdoom.org/wiki/Scope
http://zdoom.org/wiki/Script_types

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
×