The Dink Network

Reply to Re: to much fighting

If you don't have an account, just leave the password field blank.
Username:
Password:
Subject:
Antispam: Enter Dink Smallwood's last name (surname) below.
Formatting: :) :( ;( :P ;) :D >( : :s :O evil cat blood
Bold font Italic font hyperlink Code tags
Message:
 
 
February 22nd 2004, 07:20 PM
custom_king.png
redink1
King He/Him United States bloop
A mother ducking wizard 
Yep, I've 'hidden' a lot of variables in another variable before, check out the SuperVar source. Or don't, its horribly confusing and ill-documented, and your idea of how you would do it is probably similar to how I did it.

But there really isn't any need to do it to do what you want to do with monster respawning. Seth programmed the respawning functionality directly into the engine, so you don't have to allocate global variables at all.

You just do something like this in the enemy's die procedure to prevent an enemy from ever respawning:

int &hold = sp_editor_num(&current_sprite);
editor_type(&hold, 1);

Other editor_type values are follows, stolen from the DinkC Reference:

1 - kill sprite completely
2 - draw pic from enclosed seq/frame data as a sprite WITHOUT hardness
3 - draw pic from enclosed seq/frame data as a BACKGROUND object WITHOUT hardness (can be walked on [but not] behind)
4 - draw pic from enclosed seq/frame data as a sprite WITH hardness
5 - draw pic from enclosed seq/frame data as a BACKGROUND object WITH hardness (can't walk [on or] behind)
6 - kill sprite, but let him come back after 5 minutes
7 - kill sprite, but let him come back after 3 minutes
8 - kill sprite, but let him come back after 1 minute

By the way, I would recommend that you use the values 6-7... sure, a small minority of people might get pissed about having to kill the same enemies over and over. However, 'killing the same enemies over and over' is pretty much all you do in such games as Diablo 2, so I don't see it as too much of a deal.

Not to mention, having respawning monsters allows the player to decide how strong they want to get. Do they *want* to spend extra time killing monsters to gain levels, or do they *want* to kill as few monsters as possible and suffer the consequences later when they face stronger foes?

Screenlocks, on the other hand, where you are *forced* to kill the same enemies over and over are a pain in the ass. My next D-Mod, Initiation, has a solution to that problem. Basically a screen will only screenlock once, which forces the player to battle the monsters (thereby limiting the player's progression through the game a bit and forcing them to fight), while not being a major annoyance later on when just passing through.