Savebot script
OK, this is really embarrassing, but I don't know how to make savebots. So, I searched the source folder in the develop folder for a savebot script but couldn't find one. So, how do I make a savebot?
Open dink in windinkedit+ find a savebot, find the name of the script. Copy the name, paste the name on your savebot, and Voila. That's one way to do it.
Take a savebot, give it all the hardness/repeat stuff, and then just name the script "savebot".
I think the savebot.c script is in the source folder somewhere. You just must have missed it.
I think the savebot.c script is in the source folder somewhere. You just must have missed it.

void main( void ) { sp_seq(¤t_sprite, 449); sp_sound(¤t_sprite, 34); sp_brain(¤t_sprite, 6); sp_hitpoints(¤t_sprite, 0); } void hit( void ) { say("Noisy humming thing Grr!", 1); } void talk( void ) { Playsound(18,22050,0,0,0); freeze(1); choice_start(); "Save your progress!" "Forget it, I messed up" choice_end(); unfreeze(1); if (&result == 2) { unfreeze(1); say("Bye machine...", 1); return; } choice_start(); "&savegameinfo" "&savegameinfo" "&savegameinfo" "&savegameinfo" "&savegameinfo" "&savegameinfo" "&savegameinfo" "&savegameinfo" "&savegameinfo" "&savegameinfo" "Nevermind" choice_end(); } unfreeze(1); if (&result < 11) { save_game(&result); say_xy("`%Game saved", 1, 30); } }
void main( void ) { loopmidi(1); sp_seq(¤t_sprite, 449); sp_sound(¤t_sprite, 34); sp_brain(¤t_sprite, 6); sp_hitpoints(¤t_sprite, 0); } void hit( void ) { say("Die, strange machine!", 1); } void talk( void ) { Playsound(18,22050,0,0,0); freeze(1); choice_start(); "Save your game" "Leave the strange machine" choice_end(); unfreeze(1); if (&result == 2) { unfreeze(1); return; } choice_start(); "&savegameinfo" "&savegameinfo" "&savegameinfo" "&savegameinfo" "&savegameinfo" "&savegameinfo" "&savegameinfo" "&savegameinfo" "&savegameinfo" "&savegameinfo" "Nevermind" choice_end(); unfreeze(1); if (&result < 11) { save_game(&result); say_xy("`%Game saved! Hooray!", 1, 30); } }
Thanks for the script, MsDink. Yeah, WinRAR was being mean and only extracted half the source zip before breaking it up.
I'm trying to make a duck on a screen with a script attached to it, but I want it to go after you kill it. It keeps coming back after I leave the screen and come back. How can I fix this?

I'm trying to make a duck on a screen with a script attached to it, but I want it to go after you kill it. It keeps coming back after I leave the screen and come back. How can I fix this?
Take a sabebot, give it all the hardness/repeat stuff, and then just name the script "savebot".
I think the savebot.c script is in the source folder somewhere. You just must have missed it.
Skull, that is what was supossed to be there, but oddly enough, there is no saveebot.c in the develop folder.
I think the savebot.c script is in the source folder somewhere. You just must have missed it.
Skull, that is what was supossed to be there, but oddly enough, there is no saveebot.c in the develop folder.

Kill_this_task?
I might try, yet I have a suspicion it works only like a local variable and once you come back the script is back up.
I might try, yet I have a suspicion it works only like a local variable and once you come back the script is back up.
DinkDoodler is right, it would indeed behave this way.
What you basically need to do is to make the duck 'conditionally active'. This means that you have some sort of global keeping track of what needs to happen and to make the duck active or not depending on the value of this global.
So in the script attached to the room you'd have a script like this:
And then in duck.c:
You could also use the editor_seq trick here, but when you're not making a large DMOD you'd probably not run into problems with limited globals anyway.
What you basically need to do is to make the duck 'conditionally active'. This means that you have some sort of global keeping track of what needs to happen and to make the duck active or not depending on the value of this global.
So in the script attached to the room you'd have a script like this:
void main(void) { if (&story == 6) { int &duck = create_sprite(400,200,3,21,1); sp_script(&duck,"duck"); } }
And then in duck.c:
void die(void) { &story = 7; }
You could also use the editor_seq trick here, but when you're not making a large DMOD you'd probably not run into problems with limited globals anyway.
I would do that, but can you make a sprite out of scripts from the script of a sprite made from scripts? Very confusing, I know..... because I want a guy to come out and shout at Dink for killing his duck.
yes - you would "spawn" a further script of the last one
So inside your duck one you could add something like

So inside your duck one you could add something like
if &story ==10 //or whatever number wait(500); spawn("nextduck");
Yes, but i think that a void hit(void) { followed by a create_sprite command could work too

Scripts working fine now, but now because I couldn't put it's properties in the editor I put them in scripts. The problem is:
It's not moving.
When I hit it it just stands there, with no head falling off, no blood.
It makes enough noise for a million ducks, not 1.
here are the two scripts. One is attached to a sack near the house where the guy to shout at Dink will appear, the other will be attached to the duck.
Sack script:
Duck script
It's not moving.
When I hit it it just stands there, with no head falling off, no blood.
It makes enough noise for a million ducks, not 1.
here are the two scripts. One is attached to a sack near the house where the guy to shout at Dink will appear, the other will be attached to the duck.
Sack script:
void main(void) { if(&duck == 0) { int &duck = create_sprite(289, 220, 3, 21, 1); sp_script(&duck, "duck1"); } if(&duck > 0) { return; }
Duck script
void main(void) { sp_speed(&duck, 1); sp_hitpoints(&duck, 10); say("Finally, a duck to behead!", 1); } void hit(void) { //sneaky peek: using the pirate from joshriot's GRRRaphics, dialogue taken out though int &pirate; &pirate = create_sprite(443, 207, 0, 844, 7); freeze(1); say_stop("`4!", &pirate); wait(100); say("", 1); wait(500); say_stop("`4!", &pirate); wait(50); say_stop("`4bla", &pirate); wait(50); say_stop("`4bla!", &pirate); wait(50); say_stop("", 1); wait(50); &gold -= 50; wait(1000); say_stop("`4bla.", &pirate); &gold += 50; wait(50); say_stop("`4bla", &pirate); wait(50); sp_kill(&pirate, 1); say_stop("bla", 1); &duck = 1; unfreeze(1); }
By the way, I have added &duck as a global variable in main.c so no problems there.
make_global_int("&duck", 0);
Try removing the "int" from
&duck = create_sprite(289, 220, 3, 21, 1);If &duck is a global, it's unnecessary, and might even be screwing the poor animal.
It should* work if you just remove the "int"... If you change it so that the &duck global is only used to advance the quest, remember to also change these lines in void main():
->
*it might or it might not work
sp_speed(&duck, 1); sp_hitpoints(&duck, 10);
->
sp_speed(¤t_sprite, 1); sp_hitpoints(¤t_sprite, 10);
*it might or it might not work
Removed the int, it was OK with the duck, but after I'd kill it the guy wouldn't come. After some toiling around, I made it that if the whole duck dies he'll come, but that won't work because the sprite is dead. So I made it that another script will spawn when he beheads it and now it's working perfecto!
I've made a barrier that makes dink go back until he beheads the duck and talks to the guy, but while it works when he's supposed to talk to the guy, it doesn't work when he's supposed to behead the duck.
This script is attached to the fence that's gonna be the barrier. &duck is a global variable.
This script is attached to the fence that's gonna be the barrier. &duck is a global variable.
void main(void) { sp_touch_damage(¤t_sprite, -1); sp_nodraw(¤t_sprite, 1); } void touch(void) { if(&duck == 0) { freeze(1); move_stop(1, 8, 200, 1); say("I wanna behead that duck!", 1); unfreeze(1); } if(&duck == 1) { freeze(1); move_stop(1, 8, 200, 1); say("I should talk to that cranky pirate", 1); unfreeze(1); } }
This comes back to using &duck for the duck... D'oh!
When you do the &duck = create_sprite(blah blah blah); thing, &duck's value changes from 0 to whatever (the new sprite's sprite number).
It's probably best to do what I think you meant to in the first place, ie. use a local variable to create the duck, instead of the &duck global.
When you do the &duck = create_sprite(blah blah blah); thing, &duck's value changes from 0 to whatever (the new sprite's sprite number).
It's probably best to do what I think you meant to in the first place, ie. use a local variable to create the duck, instead of the &duck global.
Oh, thanks scratcher.
I'll change the global to &quackBgone like MsDink said
so funny
I'll change the global to &quackBgone like MsDink said

Nope didn't work duck wouldn't come like before, tried this, nothing
void main(void) { sp_touch_damage(¤t_sprite, -1); sp_nodraw(¤t_sprite, 1); } void touch(void) { if(&duck == create_sprite(289, 220, 3, 21, 1)) { freeze(1); move_stop(1, 8, 300, 1); say("I wanna behead that duck!", 1); unfreeze(1); } if(&duck == 1) { freeze(1); move_stop(1, 8, 300, 1); say("I should talk to that cranky pirate", 1); unfreeze(1); } }
Aww I dont think it will work with over 8 letters tho DD - sowwy
DukbGon may work tho heh

used &quack. It works, kinda, but the duck doesn't die, doesn't have hitpoints or a basewalk.

void main(void) { sp_speed(&quack, 1); sp_hitpoints(&quack, 10); sp_base_walk(&quack, 20); say("Finally, a duck to behead!", 1); } void die(void) { spawn("pirate"); }
added &quack as a global variable. (Dangit, do I have to do it for EVERY sprite to create!?)
Now it's working fine. Did a whole screen.... *yawn* me done D-modding fer the day....
Now it's working fine. Did a whole screen.... *yawn* me done D-modding fer the day....
//script where duck is created
&quack = create_sprite(289, 220, 3, 21, 1);
sp_script(&quack, "duck1");
//duck1.c script
void main(void)
{
sp_speed(&quack, 1);
sp_hitpoints(&quack, 10);
sp_base_walk(&quack, 20);
Something like this can't work unless &quack is a global... Local variables only work inside the same script where you create them. When the game switches to the duck1.c script, it has no idea who the duck &quack is supposed to be anymore. You need to use ¤t_sprite instead. Or you can do this:
//script where duck is created
int &quack = create_sprite(289, 220, 3, 21, 1);
sp_script(&quack, "duck1");
//duck1.c script
void main(void)
{
int &quack = ¤t_sprite;
sp_speed(&quack, 1);
sp_hitpoints(&quack, 10);
sp_base_walk(&quack, 20);
Thanks for the info, I've already made it a global but I'll this method next time.