The Dink Network

Scripting question

January 30th 2003, 01:57 AM
fish.gif
Binirit
Peasant She/Her
 
This must be a very easy one to answer, and I feel like a newbie asking, but since I have no clue how to do it...

How do you put a static graphic (a wall and such) on screen by using a procedure?

I've tried the int &name = create_sprite(); but that doesn't work.

And how do you move such a sprite without seeing the other sprites that are in the same sequence?

Like moving a wall - I've seen it in some D-mod, but can't remember which one.

Thanks.
January 30th 2003, 03:07 AM
custom_simon.gif
SimonK
Peasant He/Him Australia
 
: This must be a very easy one to answer, and I feel like a newbie asking, but since I have no clue how to do it...

: How do you put a static graphic (a wall and such) on screen by using a procedure?

: I've tried the int &name = create_sprite(); but that doesn't work.

: And how do you move such a sprite without seeing the other sprites that are in the same sequence?

What brain are you giving the sprite?

Have you set sp_speed()?

Set brain to 0, give a speed of say 3 and see what happens. I usually have sprites that are static placed in the map already and then attach a script that moves them on certain triggers (ie being pushed, hit...) So I'm not sure 100% on the brain setting (I don't actually set it via the script).

: Like moving a wall - I've seen it in some D-mod, but can't remember which one.

: Thanks.

January 30th 2003, 03:50 AM
maidenp.gif
maybe preloading the sequence helps ???
January 30th 2003, 11:34 AM
fish.gif
Binirit
Peasant She/Her
 
: : This must be a very easy one to answer, and I feel like a newbie asking, but since I have no clue how to do it...

: : How do you put a static graphic (a wall and such) on screen by using a procedure?

: : I've tried the int &name = create_sprite(); but that doesn't work.

: : And how do you move such a sprite without seeing the other sprites that are in the same sequence?

: What brain are you giving the sprite?

: Have you set sp_speed()?

: Set brain to 0, give a speed of say 3 and see what happens. I usually have sprites that are static placed in the map already and then attach a script that moves them on certain triggers (ie being pushed, hit...) So I'm not sure 100% on the brain setting (I don't actually set it via the script).

I set speed to 1, but I'll try 3. I've given it brain 0. I would like to attach a script, but it's in the intro, so no one can trigger it, at least not the player.
January 30th 2003, 11:36 AM
fish.gif
Binirit
Peasant She/Her
 
: maybe preloading the sequence helps ???

It's not supposed to be a sequence, if that's what you mean. It's just a wall, that is supposed to move when I want it to, but I can't even get the wall to appear on screen when using int &name = create_sprite();, let alone move it.
January 30th 2003, 11:42 AM
custom_king.png
redink1
King He/Him United States bloop
A mother ducking wizard 
: : maybe preloading the sequence helps ???

: It's not supposed to be a sequence, if that's what you mean. It's just a wall, that is supposed to move when I want it to, but I can't even get the wall to appear on screen when using int &name = create_sprite();, let alone move it.

Um... you are doing like:

//beginning of script

int &name = &create_sprite(200,100,0,31,25);

sp_speed(&name,1);

//junk goes here

move_stop(&name,2,300,1);

right?
January 30th 2003, 12:19 PM
fish.gif
Binirit
Peasant She/Her
 
: : : maybe preloading the sequence helps ???

: : It's not supposed to be a sequence, if that's what you mean. It's just a wall, that is supposed to move when I want it to, but I can't even get the wall to appear on screen when using int &name = create_sprite();, let alone move it.

: Um... you are doing like:

: //beginning of script

: int &name = &create_sprite(200,100,0,31,25);

: sp_speed(&name,1);

: //junk goes here

: move_stop(&name,2,300,1);

: right?

I've figured it out. I thought of that, and then I saw your example, Redink1. I used sp_base_walk(); and freeze(); too. Stupid! Without those it works fine. Thanks, guys!
January 30th 2003, 02:07 PM
maidenp.gif
It's not supposed to be a sequence, if that's what you mean.

Nope but if you use lots of created frames you will have to preload the seq even if it's not a sequence...

but I works so don't pay attention to this post...
January 31st 2003, 03:49 AM
spike.gif
: It's not supposed to be a sequence, if that's what you mean.

: Nope but if you use lots of created frames you will have to preload the seq even if it's not a sequence...

: but I works so don't pay attention to this post...

No, you should always preload the seq. even if it works fine, it might not work on someone else's computer.