The Dink Network

Reply to Re: discarded dmod ideas?

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:
 
 
August 23rd 2006, 08:22 PM
peasantmg.gif
ehasl
Peasant He/Him
 
Ah, this is the place where I post my dead projects. Nice initiative, Josh. Hehe.

A long time ago I released a timed exploding fireball as DinkGrenade on DN. Much later, after some negative reviews (mostly because it was not what the name would suggest), I wanted to make a new version. The new features would be grenade graphics (I actually made the inventory graphic good, just a green bomb: http://home.online.no/~sorica/grenade.gif)
and realistic physics, both throwing, gravity and collisions. It is possible to make, but I do not care enough. Feel free to use the graphic or any ideas for your own mods.

My other dead project is called "Battle Demonstration", and is basically some scripts that are supposed to show a flexible way to make battles between different teams of NPCs and monsters and Dink (or other playing characters). I am apparently too lazy to just perfect and release it, but I will put up some of the basic system here:
first the title screen (not really a part of the system, but I think it looks good. Sword stolen from Morrowind. ): http://home.online.no/~sorica/battle_title.jpg
and
http://home.online.no/~sorica/battle_title.bmp

The short version is this: sp_gold stores the team of the sprite. Everything else is just the way the sprite treats enemies and attackers. Dink is ignored in the demonstration, but that can easily be changed. Also, in this script only the sp_gold and the sp_brain are necessarily left unchanged, if you do not want really different behavior. I think one weakness of the script is that it does not search through sprites with all types of brains.

Then the long version, the script. I am sure it is terrible:
script for one sprite
void main( void )
{
//the following are local integers used for targeting
int &teamb;
int &mtargetb;
int &attackerb;
//This is the team of the current sprite.
int &current_teamb = 2;
//The following is not important for the targeting...
int &mcounter;

sp_speed(&current_sprite, 1);
sp_strength(&current_sprite, 10);
sp_defense(&current_sprite, 0);
sp_hitpoints(&current_sprite, 40);
sp_brain(&current_sprite, 9);
sp_distance(&current_sprite, 50);
sp_range(&current_sprite, 30);
sp_timing(&current_sprite, 0);
sp_nohit(&current_sprite, 0);

sp_base_walk(&current_sprite, 600);

preload_seq(601);
preload_seq(603);
preload_seq(607);
preload_seq(609);

sp_base_death(&current_sprite, 550);

preload_seq(551);
preload_seq(553);
preload_seq(557);
preload_seq(559);

sp_base_attack(&current_sprite, 590);

preload_seq(592);
preload_seq(594);
preload_seq(596);
preload_seq(598);

wait(500);
goto check;
}

void check()
{
check:
wait();
//This is the team of the current sprite. Since sp_gold is unused, I can store anything in it.
sp_gold(&current_sprite, &current_teamb);

//Find the current target...
&mtargetb = sp_target(&current_sprite, -1);

//If there is no target, or the target is Dink, get a new one.
if (&mtargetb < 2)
{
sp_target(&current_sprite, 0);
goto target;
}

//If the current target is friendly, try again.
&teamb = sp_gold(&mtargetb, -1);
if (&teamb == &current_teamb)
{
sp_target(&current_sprite, 0);
goto target;
}
//Return to check after waiting 0,2 seconds.
wait(200);
goto check;

target:
wait();

&mtargetb = get_rand_sprite_with_this_brain(9, &current_sprite);
if (&mtargetb > 0)
{
//if the new target is friendly, try again.
&teamb = sp_gold(&mtargetb, -1);
if (&teamb == &current_teamb)
{
goto target;
}
if (&teamb != &current_teamb)
{
//if the new target is an enemy, go on and attack it
sp_target(&current_sprite, &mtargetb);
}
}
//Return to check again...
goto check;
}

void hit()
{
&attackerb = &enemy_sprite;
//check the team of the sprite that just hit the current one
&teamb = sp_gold(&attackerb, -1);
if (&teamb == &current_teamb)
{
//If the new target is friendly , get a new one, using "target".
goto target;
}
if (&teamb != &current_teamb)
{
//If it is an enemy, though, go on and attack
sp_target(&current_sprite, &attackerb);
playsound(29, 22050, 0, &current_sprite, 0);
}
//Return to check, to make sure the sprite remains active and fighting.
goto check;
}

void attack()
{
playsound(31, 22050,0,&current_sprite, 0);
&mcounter = random(2000,0);
sp_attack_wait(&current_sprite, &mcounter);

//Return to check, to make sure the sprite remains active and fighting.
goto check;
}

Script finished. Understand?