trigger
One extra procedure I'd like to see is an "item_use", triggered when dink uses the currently-armed item. There were a few other procedures I thought of which could be useful, but most could be done with variations of the following.
void main( void )
{
//don't want to get interrupted, so let's split this instance
script_attach(¤t_sprite);
sp_script(¤t_sprite, "whatever");
while(wait(17))
{
if (whatever)
{
//stuff you want to happen
}
}
}
That should let almost any event trigger a sprite reaction (exception noted above) as long as wait() returns an integer.
void main( void )
{
//don't want to get interrupted, so let's split this instance
script_attach(¤t_sprite);
sp_script(¤t_sprite, "whatever");
while(wait(17))
{
if (whatever)
{
//stuff you want to happen
}
}
}
That should let almost any event trigger a sprite reaction (exception noted above) as long as wait() returns an integer.
Of course, you can also do that without the while statement using goto, as we do now.
... what?
There's already the 'use' procedure for when Dink uses the currently-armed item... so I assume you mean something like an 'item_use' procedure for enemy sprites, to be triggered when Dink uses an item, almost like 'hit'?
If that's the case, I can't think of any way it would work properly. Please explain.
There's already the 'use' procedure for when Dink uses the currently-armed item... so I assume you mean something like an 'item_use' procedure for enemy sprites, to be triggered when Dink uses an item, almost like 'hit'?
If that's the case, I can't think of any way it would work properly. Please explain.
Sorry if I'm not being very clear... the incomprehensibility is due to the crappiness of the idea.
But yeah, you get the idea. It would be pretty cool if you could make enemies react when Dink uses a weapon. So they could jump back when he attacks or something.
It's not like it's terribly hard to do this now by playing with globals (in the use() proc) and attaching a loop to the monster, but it'd be nice if Windemere had an actual procedure for it, because loops are complicated (and they eat into the script limit, but that shouldn't be a problem with Windemere.)
It's not important, just something that would be nice. The only procedure really missing from DS is a version of damage() for brain 9.
I suppose you could also have something which is run when an attack kills it's target, but you can already do that in a roundabout way with run_script_by_number.
But yeah, you get the idea. It would be pretty cool if you could make enemies react when Dink uses a weapon. So they could jump back when he attacks or something.
It's not like it's terribly hard to do this now by playing with globals (in the use() proc) and attaching a loop to the monster, but it'd be nice if Windemere had an actual procedure for it, because loops are complicated (and they eat into the script limit, but that shouldn't be a problem with Windemere.)
It's not important, just something that would be nice. The only procedure really missing from DS is a version of damage() for brain 9.
I suppose you could also have something which is run when an attack kills it's target, but you can already do that in a roundabout way with run_script_by_number.
I'm not quite sure what you mean by 'make enemies react when Dink uses a weapon'. I have two main ideas:
1) Run the 'item_use' procedure for all of the sprites on the screen whenever Dink uses an item.
2) Run the 'item_use' procedure for enemies within the range of Dink's special hit frame.
Number 1 is fairly easy to do... in the item script, use a loop to go through all of the sprites on the screen, checking for sp_gold values, and using run_script_by_number to execute a procedure if available.
Number 2 will be easy to do with v1.08... &missile_source will be used for all attacks, not just missiles, so you could have something like this:
void hit(void)
{
if (&missile_source == 1)
{
say("`4Ouch, Dink hit me.", ¤t_sprite);
}
}
1) Run the 'item_use' procedure for all of the sprites on the screen whenever Dink uses an item.
2) Run the 'item_use' procedure for enemies within the range of Dink's special hit frame.
Number 1 is fairly easy to do... in the item script, use a loop to go through all of the sprites on the screen, checking for sp_gold values, and using run_script_by_number to execute a procedure if available.
Number 2 will be easy to do with v1.08... &missile_source will be used for all attacks, not just missiles, so you could have something like this:
void hit(void)
{
if (&missile_source == 1)
{
say("`4Ouch, Dink hit me.", ¤t_sprite);
}
}
Actually, I would like to see a while / for loop working in Dink.
@redink: I meant the first one. Your suggestion is good, but I still think it'd be cool if Windemere had something like that hardcoded. There are 5 things that can happen in combat:
1.Dink attacks
2.Dink hits
3.Monster attacks
4.Monster hits
5.Monster dies
A monster script has procedures triggered by 2, 3, and 5 (hit(), attack(), and die()) It'd be nice if it had procedures triggered by 1 and 4.
1.Dink attacks
2.Dink hits
3.Monster attacks
4.Monster hits
5.Monster dies
A monster script has procedures triggered by 2, 3, and 5 (hit(), attack(), and die()) It'd be nice if it had procedures triggered by 1 and 4.
It would be pretty cool if you could make enemies react when Dink uses a weapon. So they could jump back when he attacks or something.
I remember in Cast Awkening, that the zombies teleported when you hit them, or cast a spell on them. I don't know, but I think the enemy should have something in the hit procedure, that should make them jump back. Maybe "move" should work.
I remember in Cast Awkening, that the zombies teleported when you hit them, or cast a spell on them. I don't know, but I think the enemy should have something in the hit procedure, that should make them jump back. Maybe "move" should work.
That was actually done in the way Milobones described in the original post.
Each zombie had a loop which checked to see what Dink's current sequence was. If it was in the 70's or 10's (i.e. he was walking), then it didn't do anything. However, if his sequence was in the 100's (when he attacked), then the zombie would try to teleport.
Each zombie had a loop which checked to see what Dink's current sequence was. If it was in the 70's or 10's (i.e. he was walking), then it didn't do anything. However, if his sequence was in the 100's (when he attacked), then the zombie would try to teleport.