: So I have this door that I want to open when a lever on the wall is turned. I can remove the hardness o.k. ,but the seq. of the door swinging open is attached to the warp thing. Is there a way to script that seq. without a warp?Thanks....Ric
First of all, I'd use one script, and I'd have it attached to the switch, let's call it "lever.c". Now, within that script's main, we'd want to create the door, this will eliminate the need for creating the door in the DinkMapEditor. By creating the door through the script we gain more control over it (ie. we'll already have an identifier, "&door", for the door)
Here's an example:
void main()
{
preload_seq(840);
int &door = create_sprite(164, 40, 0, 840, 1);
sp_hard(&door, 0);
draw_hard_sprite(&door);
}
Keep in mind that you'll probably have to change the non-zero values to fit your door's sequence and coordinates on the map. Also, I've found that it's very important to add the preload_seq() command when you want to instantly create something with hardness.
Now, in the same script, we add something like the following:
void talk()
{
sp_seq(&door, 840);
sp_hard(&door, 1);
draw_hard_sprite(&door);
}
This opens plays the door opening sequence, and removes its hardness. Just remember that the number in the "sp_seq" will be the same as the door's.
This is probably more than you wanted to know, but it should give you some insite on advanced scripting that will help out a ton on procedures such as these. Feel free to post again if this didn't help out. :)
: : So I have this door that I want to open when a lever on the wall is turned. I can remove the hardness o.k. ,but the seq. of the door swinging open is attached to the warp thing. Is there a way to script that seq. without a warp?Thanks....Ric
: There sure is! There are tons of different ways to it, too. Now, since I'm going on a limited amount of information here, I'll just tell you how I'd make this work.
: It'll be in the post after this one, just to let people know I got this question covered.
The door script has a loop looking for a &var change, If &var changes, sp_hard(1), and hopefully I can make the door swing open. I can also layer a door and change dot depth, but it doen't look as natural cause the door just skips from first frame to last.