The Dink Network

Reply to Re: New Dev File: Platform Transportation

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:
 
 
April 19th 2010, 08:48 AM
custom_magicman.gif
magicman
Peasant They/Them Netherlands duck
Mmmm, pizza. 
Try giving whatever it is that uses touch() or damage() a button brain, and use buttonon(). buttonon() works just like damage() specialized for Dink. It triggers every time when Dink (or, more accurately, sprite number 1, which sometimes happens to be a mouse cursor, and other times happens to be Dink) enters the hardbox.
Its complement is buttonoff(), which triggers every time Dink leaves the hardbox. Because it doesn't interfere in any way with other missiles like damage() does, or with other sources of damage like touch() does, it can be a good solution when those other two don't work.

The only use-case in which buttonon() is harder to use is when you need touch()'s behaviour of continually triggering when Dink touches it. The solution here would be to meddle with sp_brain_parm(). It's where a button brain stores whether Dink is on it or not. I just forgot if it was 0 or 1 that means "Dink is on it now".

Sadly, buttonon() and buttonoff() only work for sprite number 1. You can't make it trigger for enemies.

Yeah, I haven't tried it yet, so I'm just guessing here. Feel free to berate me for not knowing what I'm talking about