The Dink Network

Reply to Re: New *WORKING* cross-platform editor

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 4th 2011, 06:57 AM
anon.gif
shevek
Ghost They/Them
 
Could you provide a few examples of the new coding?

Here's a script for an axe item while being a knight:

void use ()
{
        // disallow diagonal hits, the animations don't exist.
        int d = sp_dir (1, -1);
        if (d == 1 || d == 3)
                d = 2;
        if (d == 7 || d == 9)
                d = 8;
        // use attack sequence for this direction.
        sp_seq(1, seq_code ("silverknightattack 2") - 2 + d);
        sp_frame(1, 1); 
        sp_nocontrol(1, 1); 
}


This is compiled into hardly readable but working:

void use(void)
{
	//disallow diagonal hits, the animations don't exist.
	int &tmp0 = 0;
	&tmp0 -= 1;
	int &tmp1 = sp_dir(1, &tmp0);
	int &m3d = &tmp1;
	int &tmp0 = 1;
	if (&m3d != 1)
	{
		if (&m3d != 3)
			&tmp0 = 0;
	}
	if (&tmp0 == 1)
	{
		&m3d = 2;
	}
	int &tmp0 = 1;
	if (&m3d != 7)
	{
		if (&m3d != 9)
			&tmp0 = 0;
	}
	if (&tmp0 == 1)
	{
		&m3d = 8;
	//use attack sequence for this direction.
	}
	int &tmp1 = 722;
	&tmp1 -= 2;
	int &tmp0 = &tmp1;
	&tmp0 += &m3d;
	sp_seq(1, &tmp0);
	sp_frame(1, 1);
	sp_nocontrol(1, 1);
}