Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Siriuss

Monster dead => Lose game?

Recommended Posts

I want to do it like this:
I have a friendly monster and if he dies i lose the game.
I tried to make this:

Script 1 (void)
{
    int health = GetActorProperty(1, APROP_HEALTH);
    
    if(health < 0)
    {
        Exit_Normal(0);
    }
}
It wotn work?
Whats wrong?
Or is there a command how to make my own Health 0 if his hp is 0 or below?

Share this post


Link to post

Ok i got it:

Script 2 (void)
{
    int health = GetActorProperty(1, APROP_HEALTH);
    
    if(health < 0)
    {
        SetActorProperty(0, APROP_HEALTH, 0);
    }
    restart;
}
And the monster tid 1 and 80:Scriptexecute.

But 1 question:
If he dies and my health is 0, i can STILL move, no death animation and sound is played but i cant shoot or use.

How to fix this

Share this post


Link to post
Siriuss said:

Seriously: i dont like to go on wiki of zdoom.

And I don't like to help people who don't make a honest effort first.


You probably know the saying: "Give a man a fish, he'll be fed for one day. Teach him to fish, he'll be fed for all his life."

It's the same idea here. The wiki will teach you to catch fish. It's its purpose. You can ask for help on the forums if you don't understand something or honestly cannot find it; but you cannot ask people to do all the work for you. Nobody is going to give you their fish (they need them for their avatars after all). You can expect hints and a bit of assistance, but not for people to do all the work for you.

Also, it's more fulfilling to do something by yourself than it is to whine at people until they do it for you. It's also more likely to work.

Share this post


Link to post

I would do it like so:

script 1 OPEN
{
While(ThingCount(T_<MONSTER TYPE>, <THING_ID>) > 0)
Delay(35);

Exit_Normal(0);
}

the Monster type can be left as T_NONE

Share this post


Link to post

I'd put another player 1 start in a dummy sector, and put a thing action on the friendly monster that crushes the dummy sector (it will crush when the monster dies).

Share this post


Link to post

Only a little point I need to prove... for me, exiting the level and going to the next is not actually "loosing" the game, but progressing. (I'm assuming that just by looking at your script) Having to restart this map all over again is more like loosing to me. Just a thought....

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
×