📧 Message Board Archive

Script Help
Hi folks,      



Great new board.  Let's just keep this one and not tell the other site ;)



I've been playing Dink and DMODS for about a year now and have just loved it.  I am often 'lurking' on the other board and DN trying to get tips on games and asking the odd question now and then.  Nothing serious.  I'm not a programmer so I thought playing the games that other, very talented, people produce would be the best I could hope for.  

Well, I've decided to take the big plunge and try and create a DMOD.  Now hoold on a minute.... nothing serious now!!  I should have said that I'm going to TRY and make a DMOD.  Don't ask for story lines and timelines and stuff like that.  As I said, brand spanking newbie with no programming skills but very eager to learn.  I've downloaded all the tut's from DN and the skeleton and all of the other obvious stuff.  If there are more resources that are not on the DN then let me know and I will gladly download them and add them to the volumes I already have.  I'm going to do what was suggested in one of the tut's and that is - produce one that no-one ever see's, just to get the experience.  And having made a map, can I just say from the outset - Hardness IS A BIT$$ -



Where I will need lots of help is scripts.  I'm probably going to plagiarize most of them but I'm at my first dead end.  I've spawned a script at the end of start1.c for an intro and it all works just fine..... - except for the wizard doesn't actually appear.  His text does and his sound effect does, but he doesn't.  Could someone please have a look at this and tell me what's gone wrong;



//wizard cut scene



void main( void )

{

freeze(1);

playmidi("wanderer.mid");

int &mcrap = create_sprite(260, 319, 7, 167, 1);

sp_seq(&mcrap, 167);

sp_speed(&current_sprite, 1);

playsound(24, 22052, 0, 0, 0);

wait(300);

say_stop("What the...", 1);

wait(300);





I've even changed the sequence to 573 but still a no show.  Any suggestions gratefully accepted.  



ESKAY







Re: Script Help
: //wizard cut scene

: void main( void )

: {

: freeze(1);

: playmidi("wanderer.mid");

: int &mcrap = create_sprite(260, 319, 7, 167, 1);

: sp_seq(&mcrap, 167);

: sp_speed(&current_sprite, 1);

: playsound(24, 22052, 0, 0, 0);

: wait(300);

: say_stop("What the...", 1);

: wait(300);



: I've even changed the sequence to 573 but still a no show. Any suggestions gratefully accepted.



: ESKAY



I am a DMOD newbie myself and currently try to write a DMOD as well. From my point of view, the problem of your script is: you never create the wizard. If this is the spawned script, the script is attached to the screen instead of a sprite. Thus no &current_sprite would be found. You probably need to add something like



int &wizard = create_sprite(260, 319, 16, 573, 1);

sp_seq(&wizard, 573);

sp_speed(&wizard, 1);



You might also need to set some other things for this wizard like



sp_hard(&wizard, 1);

sp_base_walk(&wizard, 570);



etc.



And, yes, put



preload_seq(571);

preload_seq(573);

preload_seq(577);

preload_seq(579);



in the beginning of the script, although it might not be necessary in your case. (I'm not sure.)



Hope this would help.
Re: Script Help
: Hi folks,



: Great new board. Let's just keep this one and not tell the other site ;)



: I've been playing Dink and DMODS for about a year now and have just loved it. I am often 'lurking' on the other board and DN trying to get tips on games and asking the odd question now and then. Nothing serious. I'm not a programmer so I thought playing the games that other, very talented, people produce would be the best I could hope for.



: Well, I've decided to take the big plunge and try and create a DMOD. Now hoold on a minute.... nothing serious now!! I should have said that I'm going to TRY and make a DMOD. Don't ask for story lines and timelines and stuff like that. As I said, brand spanking newbie with no programming skills but very eager to learn. I've downloaded all the tut's from DN and the skeleton and all of the other obvious stuff. If there are more resources that are not on the DN then let me know and I will gladly download them and add them to the volumes I already have. I'm going to do what was suggested in one of the tut's and that is - produce one that no-one ever see's, just to get the experience. And having made a map, can I just say from the outset - Hardness IS A BIT$$ -



: Where I will need lots of help is scripts. I'm probably going to plagiarize most of them but I'm at my first dead end. I've spawned a script at the end of start1.c for an intro and it all works just fine..... - except for the wizard doesn't actually appear. His text does and his sound effect does, but he doesn't. Could someone please have a look at this and tell me what's gone wrong;



: //wizard cut scene



: void main( void )



: {



: freeze(1);



: playmidi("wanderer.mid");



: int &mcrap = create_sprite(260, 319, 7, 167, 1);



: sp_seq(&mcrap, 167);



: sp_speed(&current_sprite, 1);



: playsound(24, 22052, 0, 0, 0);



: wait(300);



: say_stop("What the...", 1);



: wait(300);



: I've even changed the sequence to 573 but still a no show. Any suggestions gratefully accepted.



: ESKAY





The answer is very simple : brain 7 runs the sequence once, then kills it. Change it to brain 0 if it doesn't have to move or anything, brain 9 if you want it to move diagonally (for monsters), brain 10 if you want it to move in the 2,4,6,8 directions (requires the special graphics for it) or brain 16 for ordinary people.



I hope I've been of help and good luck!

Re: Script Help
: : Hi folks,



: : Great new board. Let's just keep this one and not tell the other site ;)



: : I've been playing Dink and DMODS for about a year now and have just loved it. I am often 'lurking' on the other board and DN trying to get tips on games and asking the odd question now and then. Nothing serious. I'm not a programmer so I thought playing the games that other, very talented, people produce would be the best I could hope for.



: : Well, I've decided to take the big plunge and try and create a DMOD. Now hoold on a minute.... nothing serious now!! I should have said that I'm going to TRY and make a DMOD. Don't ask for story lines and timelines and stuff like that. As I said, brand spanking newbie with no programming skills but very eager to learn. I've downloaded all the tut's from DN and the skeleton and all of the other obvious stuff. If there are more resources that are not on the DN then let me know and I will gladly download them and add them to the volumes I already have. I'm going to do what was suggested in one of the tut's and that is - produce one that no-one ever see's, just to get the experience. And having made a map, can I just say from the outset - Hardness IS A BIT$$ -



: : Where I will need lots of help is scripts. I'm probably going to plagiarize most of them but I'm at my first dead end. I've spawned a script at the end of start1.c for an intro and it all works just fine..... - except for the wizard doesn't actually appear. His text does and his sound effect does, but he doesn't. Could someone please have a look at this and tell me what's gone wrong;



: : //wizard cut scene



: : void main( void )



: : {



: : freeze(1);



: : playmidi("wanderer.mid");



: : int &mcrap = create_sprite(260, 319, 7, 167, 1);



: : sp_seq(&mcrap, 167);



: : sp_speed(&current_sprite, 1);



: : playsound(24, 22052, 0, 0, 0);



: : wait(300);



: : say_stop("What the...", 1);



: : wait(300);



: : I've even changed the sequence to 573 but still a no show. Any suggestions gratefully accepted.



: : ESKAY





Hmm.. I'd got something to say too, maybe you just didn't write it to the post but i couldn't see a } at the end of the script. (Or then your script didn't end up there.)

There always needs to be } (somebody called it wee) at the end of task or something may not work.



Oh, and i had a bug that i needed to preload the seq i wanted to play or it didn't show up. - But that's pretty rare. In this case you would need to write in your script this:



preload_seq(167);





Hope i did at least something,

~Scratcher :)



Re: Script Help
: Oh, and i had a bug that i needed to preload the seq i wanted to play or it didn't show up. - But that's pretty rare. In this case you would need to write in your script this:



: preload_seq(167);



That ain't rare, i got it a while ago too. It's annoying, for now I have to add it to every damn script.. ;)

Re: Script Help
Ya, preload is the problem, the script looks as if it's creating an explosion the is spwne than kill. So the brain wouldn't be a problem.



--WC
Re: Script Help
Thanks to everybody.



I'll try some of these and get back to you.



I expect I'll need a lot of help with scripting, so stay tuned.



SK
Re: Script Help
: Thanks to everybody.



: I'll try some of these and get back to you.



: I expect I'll need a lot of help with scripting, so stay tuned.



: SK



Oh! I thought you were spawning a wizard with the create_sprite command instead of an explosion :)

Re: Script Help
: : Thanks to everybody.



: : I'll try some of these and get back to you.



: : I expect I'll need a lot of help with scripting, so stay tuned.



: : SK



: Oh! I thought you were spawning a wizard with the create_sprite command instead of an explosion :)



Yeh, so did I!!



I got it to work by leaving that one there and then taking the advice to directly create another sprite, which was the &wizard.  Now I get a very cool explosion with the wizard appearing immediately after.  I couldn't get the text to stick to the wizard sprite so I finished off by attaching the text directly to &wizard instead of &current_sprite.  The whole intro works now - thanks to all:)



Lots more nasty questions to come  bwahahahaha.  SK