📧 Message Board Archive

create_sprite (help!!!!)
I'm still having a few problems with creating sprites in a script. I look at some eg.s from the original dink and I notice the brain and base walk were usualy done separate, rather than in the create_sprite(parms). eg:



int &dude = create_sprite(30,130,0,0,0);

base_walk(&dude, 123);

sprite_brain(&dude,16);



Is there an advantege to this?
Re: create_sprite (help!!!!)
: I'm still having a few problems with creating sprites in a script. I look at some eg.s from the original dink and I notice the brain and base walk were usualy done separate, rather than in the create_sprite(parms). eg:

: int &dude = create_sprite(30,130,0,0,0);

: base_walk(&dude, 123);

: sprite_brain(&dude,16);

: Is there an advantege to this?



I don't think so, you definitly need to put in the seq and frame #s, even if you leave the brain at 0.  I could see creating an enemy with one of its attack sequences in the create_sprite parms and then using sprite_base_walk to set the walk, but using 0 for everything probably wouldn't do a darn thing!  Another thing thats helpful is to preload the sequence in main().

Re: create_sprite (help!!!!)
: : I'm still having a few problems with creating sprites in a script. I look at some eg.s from the original dink and I notice the brain and base walk were usualy done separate, rather than in the create_sprite(parms). eg:

: : int &dude = create_sprite(30,130,0,0,0);

: : base_walk(&dude, 123);

: : sprite_brain(&dude,16);

: : Is there an advantege to this?

: I don't think so, you definitly need to put in the seq and frame #s, even if you leave the brain at 0. I could see creating an enemy with one of its attack sequences in the create_sprite parms and then using sprite_base_walk to set the walk, but using 0 for everything probably wouldn't do a darn thing! Another thing thats helpful is to preload the sequence in main().



Ya I'd think so, but in source.c many eg.s like "s3-st-2" start those at 0. ( and work better than mine...Grrrr.)

weird.
Re: create_sprite (help!!!!)
No, leaving them zero won't make it work any better. I don't know that it will do any hard either, but it won't help. Can you elaborate on the touble you're having?
well, it's like this......
void main ()

{

int &bol;

int &hench;

preload_seq(863,1);

preload_seq(281,1);

&bol = create_sprite(250,250,0,0,0);

&hench = create_sprite(450,220,0,0,0);

sp_brain(&bol,16);

sp_brain(&hench,16);

sp_base_walk(&bol,860);

sp_base_walk(&hench,280);

}

// this script is attached to a blocker in the room(for later actions). When entering the room I  am sure &vision and &story are right but alas! no spriptes............
oh, i get it.......
I just got this to work with a room script instead. But why would't it work attached to a sprite???????
Re: oh, i get it.......
: I just got this to work with a room script instead. But why would't it work attached to a sprite???????



Certain kinds of sprites can't have scripts atached to them (or rather won't use them if they do) You said it was a "blocker", does that mean one of those invisible things that make Dink say "No, cna't go that way". And if so, by any chance did you make it invisible by setting it's type to 2?
Re: oh, i get it.......
: : I just got this to work with a room script instead. But why would't it work attached to a sprite???????

: Certain kinds of sprites can't have scripts atached to them (or rather won't use them if they do) You said it was a "blocker", does that mean one of those invisible things that make Dink say "No, cna't go that way". And if so, by any chance did you make it invisible by setting it's type to 2?

ya, that kind, but not to stop dink, just let a henchman know when dink went too far(touch-attack).I take it thats one of those you can't put such a script on. Oh well, rm. scrip is working fine. Thanks
Re: oh, i get it.......
: : : I just got this to work with a room script instead. But why would't it work attached to a sprite???????

: : Certain kinds of sprites can't have scripts atached to them (or rather won't use them if they do) You said it was a "blocker", does that mean one of those invisible things that make Dink say "No, cna't go that way". And if so, by any chance did you make it invisible by setting it's type to 2?



Yeah, don't use type two because it seems to be buggy.  Its better to just set the sprite's size to 1, the hard box won't change size, you get the same effect, but scripts work.