The Dink Network

Reply to Re: Bookshelf

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:
 
 
October 30th 2012, 03:56 AM
anon.gif
shevek
Ghost They/Them
 
I'll improve the answers to numbers one and two right now, because the answers are relatively incomplete compared to the other one. Or wait... Ah well.

1. If you find dmods with .d scripts, there usually isn't a ready-to-download place for the .c files. However, .d is a (lousy but) lossless compression method, so it can be decompressed into the original .c file. The freedink source has a utility "d2c" for that. Not sure how easy it is to get it running under Windows. If you want source for a specific dmod, let me know and I'll run d2c for you and send you the .c files.

2. Killing an item with sp_nodraw (to stop it being visible) and kill_this_task (to stop it doing things) works. Actually, the same result would be achieved by using the single command sp_active(&current_sprite, 0); However, this doesn't prevent it from reappearing the next time you enter the room. In other words, this is fine for generated objects (like loot from killing a monster), but usually not enough for stuff placed in the editor. For that, you need to deactivate the editor-sprite as well:
int &crap;
&crap=sp_editor_num(&current_sprite);
// Type 1 means kill it completely, see dinkc.txt for other values.
editor_type(&crap, 1);


Note that you need the sp_editor_num, because editor_type needs the number given by the editor, not the run-time number given by the engine.

Also note that this code must be before kill_this_task/sp_active, because after any of those commands, the script is killed so the rest is not executed.