blackness
in my "last battle" script something is wrong, it is ment to fade as quick as the enemy is killed,but the screen turns black (as it shall do)but you dont get teleported to another screen, here is the script
this is the first script i made, here the screen dosent even turn black, but when i took the talking away the screen turned black atleast
what is wrong?
void main( void )
{
screenlock(1);
int &mcounter;
sp_target(¤t_sprite, 1);
sp_brain(¤t_sprite, 9);
sp_speed(¤t_sprite, 2);
sp_distance(¤t_sprite, 50);
sp_range(¤t_sprite, 35);
sp_timing(¤t_sprite, 0);
sp_frame_delay(¤t_sprite, 55);
sp_exp(¤t_sprite, 120);
sp_base_walk(¤t_sprite, 780);
sp_base_attack(¤t_sprite, 770);
sp_defense(¤t_sprite, 4);
sp_strength(¤t_sprite, 20);
sp_touch_damage(¤t_sprite, 8);
sp_hitpoints(¤t_sprite, 80);
preload_seq(792);
preload_seq(794);
preload_seq(796);
preload_seq(798);
preload_seq(805);
preload_seq(801);
preload_seq(803);
preload_seq(807);
preload_seq(809);
}
void hit( void )
{
sp_brain(¤t_sprite, 9);
sp_target(¤t_sprite, &enemy_sprite);
//lock on to the guy who just hit us
//playsound
playsound(28, 22050,0,¤t_sprite, 0);
}
void talk( void )
{
int &randy = random(4, 1);
if (&randy == 1)
say("`3do you think we are friends?", ¤t_sprite);
if (&randy == 2)
say("`3die, bigwood!", ¤t_sprite);
if (&randy == 3)
say("`3he, he, i will rip out your insides!", ¤t_sprite);
if (&randy == 4)
say("`3THE WORLD IS MINE!", ¤t_sprite);
}
void die( void )
{
say_stop("DIE, WORM!!", 1);
int &hold = sp_editor_num(¤t_sprite);
if (&hold != 0)
editor_type(&hold, 6);
screenlock(0);
fade_down();
fill_screen(0);
&player_map = 219;
sp_x(1, 301);
sp_y(1, 107);
script_attach(1000);
load_screen();
draw_screen();
draw_status();
fade_up();
}
void attack( void )
{
playsound(27, 22050,0,¤t_sprite, 0);
&mcounter = random(4000,0);
sp_attack_wait(¤t_sprite, &mcounter);
}
stupid script! i was neraly done with my dmod when this problem came loose!
this is the first script i made, here the screen dosent even turn black, but when i took the talking away the screen turned black atleast
what is wrong?
void main( void )
{
screenlock(1);
int &mcounter;
sp_target(¤t_sprite, 1);
sp_brain(¤t_sprite, 9);
sp_speed(¤t_sprite, 2);
sp_distance(¤t_sprite, 50);
sp_range(¤t_sprite, 35);
sp_timing(¤t_sprite, 0);
sp_frame_delay(¤t_sprite, 55);
sp_exp(¤t_sprite, 120);
sp_base_walk(¤t_sprite, 780);
sp_base_attack(¤t_sprite, 770);
sp_defense(¤t_sprite, 4);
sp_strength(¤t_sprite, 20);
sp_touch_damage(¤t_sprite, 8);
sp_hitpoints(¤t_sprite, 80);
preload_seq(792);
preload_seq(794);
preload_seq(796);
preload_seq(798);
preload_seq(805);
preload_seq(801);
preload_seq(803);
preload_seq(807);
preload_seq(809);
}
void hit( void )
{
sp_brain(¤t_sprite, 9);
sp_target(¤t_sprite, &enemy_sprite);
//lock on to the guy who just hit us
//playsound
playsound(28, 22050,0,¤t_sprite, 0);
}
void talk( void )
{
int &randy = random(4, 1);
if (&randy == 1)
say("`3do you think we are friends?", ¤t_sprite);
if (&randy == 2)
say("`3die, bigwood!", ¤t_sprite);
if (&randy == 3)
say("`3he, he, i will rip out your insides!", ¤t_sprite);
if (&randy == 4)
say("`3THE WORLD IS MINE!", ¤t_sprite);
}
void die( void )
{
say_stop("DIE, WORM!!", 1);
int &hold = sp_editor_num(¤t_sprite);
if (&hold != 0)
editor_type(&hold, 6);
screenlock(0);
fade_down();
fill_screen(0);
&player_map = 219;
sp_x(1, 301);
sp_y(1, 107);
script_attach(1000);
load_screen();
draw_screen();
draw_status();
fade_up();
}
void attack( void )
{
playsound(27, 22050,0,¤t_sprite, 0);
&mcounter = random(4000,0);
sp_attack_wait(¤t_sprite, &mcounter);
}
stupid script! i was neraly done with my dmod when this problem came loose!
The problem is that the sprite and the script die quickly when void die(void) has been initiated.. at least something along those lines so you can't use that script to execute code with delay or cutscenes. What you need to do, is to spawn the script or create a new sprite with a script attached. Here's what I currently use in one of my scripts:
//in void die(void)
int &temp = create_sprite(-50, -50, 0, 71, 1);
sp_script(&temp, "en-tr22d");
Basically it creates a new sprite with a script attached. The script attacked then looks like:
void main(void)
{
//code
kill_this_task();
}
But, you can also spawn(); the script.
//in void die(void)
int &temp = create_sprite(-50, -50, 0, 71, 1);
sp_script(&temp, "en-tr22d");
Basically it creates a new sprite with a script attached. The script attacked then looks like:
void main(void)
{
//code
kill_this_task();
}
But, you can also spawn(); the script.
so inside those brackets after "create_sprite"
what is the numbers? sequences?
so if i want a dead goblin is 785 enough?
what is the numbers? sequences?
so if i want a dead goblin is 785 enough?
Oh, that's just a method to create a random sprite outside the screen. The player will never see it, it's just a scripting way to get a script running.. but the numbers are:
int &temp = create_sprite(-50, -50, 0, 71, 1);
//create_sprite(x, y, brain, seq, frame)
It's just one of the ways of getting it to work.. you can also spawn(); the script and never bother about creating new sprites.
int &temp = create_sprite(-50, -50, 0, 71, 1);
//create_sprite(x, y, brain, seq, frame)
It's just one of the ways of getting it to work.. you can also spawn(); the script and never bother about creating new sprites.
look at en-gmog.c, the important command is sp_brain(¤t_sprite, 0);
mmm, that's a way too... can't be bothered to 'fix' all my scripts now though But yeah, look at en-gmog.c in source.zip, good find
Man, I was really looking for a way to run a script when an enemy was killed! Thanks, all, you helped me too!
thanks! it works now! im done with my first
d-mod (tallyhooo!!)
d-mod (tallyhooo!!)
well, i have one question left...
i took some midis from fb3, and used it for my dmod.
is that allowed?
i took some midis from fb3, and used it for my dmod.
is that allowed?
Yeah, though it's best to check the D-Mod's Readme.txt to see if anything's mentioned about (midi) credits.. usually they're free midi so you can use them as well: sometimes someone creates a midi file and you're allowed to use it for free but you have to give him/her credit for it (then you can still use it but you shouldn't forget the credit, hehe)
hey, can i upload a ZIP file? because i dont know how the new dmod extractor is created.
Go here.
Then start it, choose "create dmod", put the dir name where the game should install in the top edit box and put the source dir in the bottom edit box. Your .dmod will be put in your Dink main dir.
There you go.
Then start it, choose "create dmod", put the dir name where the game should install in the top edit box and put the source dir in the bottom edit box. Your .dmod will be put in your Dink main dir.
There you go.
i have installed it already, no program is called "DF-arc" that i can open!