The Dink Network

Reply to Re: Making sprites walk

If you don't have an account, just leave the password field blank.
Username:
Password:
Subject:
Antispam: Enter Dink Smallwood's last name (surname) below.
Formatting: :) :( ;( :P ;) :D >( : :s :O evil cat blood
Bold font Italic font hyperlink Code tags
Message:
 
 
December 2nd 2002, 09:39 AM
old.gif
: I am a beginning scripter, and I would like to know how to make sprites walk. People for example. Help would be appreciated. Thanx!

First:

1. How to import new animation sprites

2. How it works

3. How to script

1:

Open dink.ini and find an empty number ( if you didnt add a new sprite, use 850 )

scroll down and add this line:

load_graphics graphicsmonster ame1- 851

load_graphics graphicsmonster ame3- 853

load_graphics graphicsmonster ame5- 855

load_graphics graphicsmonster ame7- 857

load_graphics graphicsmonster ame9- 859

BASE = 850

name1 = he walks sw

name3 = he walks se

name5 = he is dead

name7 = he walks nw

name9 = he walks ne

NOTE: They are all in the 85* base...

NOTE: When he walks sw make sure you name the file: Name1-01, for the first frame, for the second: Name1-02, etc...

NOTE: A frame is 1 bmp

NOTE: 50 frames can be imported into 1 sequence ( ie: 851 )

NOTE: Wanna make him attack, then do this

load_graphics graphicsmonsterattack1- 861

put it into another base ( ie: 860 )

etc...

2:

If you done it dinkedit should find the new sprite in the sprite menu, just press [ when you are in the menu and you will see him...

How does it work? Well, it works with a thing called "BASE":

If you make a new sprite that can move and you made the graphics and imported them into 851 - 859, then the base would be 850

if you make a new sprite that can move and attack

and you imported them into 851 - 859 ( move ) 861 - 869 ( attack )

the bases would be:

move = 850

attack = 860

3:

So, youve imported them, ok... Now, you need to script it...

Place that sprite on the ground, and give him the script called "example" by press shift+5 ( no "" ) leave dinkedit and open cedit ( my favorite script programm, download if you dont have it )

then put this into the script:

void main(void)

{

sp_base_walk(&current_sprite, ***);

sp_base_attack(&current_sprite, ***);

"and the rest, sp_hitpoints and sp_speed, etc..."

}

*** Fill in the bases and voila, you play your dmod and you should see him moving and attacking if you done this (he doesnt move or attack if you didnt gave him: )

sp_speed

sp_timing

:D

Hope you understand it :D