The Dink Network

New Dev File: Spells

December 14th 2007, 09:43 PM
custom_king.png
redink1
King He/Him United States bloop
A mother ducking wizard 
Endy has also created a collection of Spells. These include magic shields, very cool spells using shadowing and missile brains, shape shifting items, mana potions, and more.

December 15th 2007, 12:43 AM
fairy.gif
Someone
Peasant He/Him Australia
 
Fun, but scripts could do with a bit of cleaning up. I don't like the rapid swapping of brains, especially because it isn't necessary, and the missile shield doesn't always work.

A better solution for the missile shield is to only use shadow brain and detect missiles with hit() and &missle_source (missiles still trigger hit even on a shadow brain and w/ sp_nohit 1).

For the offensive "shield" it may be better just to keep it as missile brain and code it in DinkC to follow Dink when he moves (he'll trigger damage()).

The code that makes enemies sleep until Dink gets close isn't worth a constant loop with an external() (and doesn't need it either). Plus it doesn't seem to work the first time you enter the screen. Better solution is to make the hardbox of the sleeping frame very large and wake up the enemy on touch() or use a large sp_distance & sp_speed of zero and wake up the sprite on first attack() (be careful what you set base_attack to in main() though, otherwise it'll look weird).

mlevel.c is weird. Why not just set &magic to zero..? Too many loops.. You could also make the same effect by playing with &update_status, but that would be a real pain.

You should also be using pseq not seq to return the seq.

Cool ideas though
December 20th 2007, 10:44 PM
wizardb.gif
Endy
Peasant He/Him United States
 
"A better solution for the missile shield is to only use shadow brain and detect missiles with hit() and &missle_source (missiles still trigger hit even on a shadow brain and w/ sp_nohit 1)."

"For the offensive "shield" it may be better just to keep it as missile brain and code it in DinkC to follow Dink when he moves (he'll trigger damage())."

Sounds good, thanks for the advice on the shields. Is a bit of an issue the enemies' missiles going through the shield while the brain swap is going on.

Sleeping Enemies:
Mainly just got annoyed with the blatant stupidity of our current enemies. You can normally walk right up to an enemy or even have to chase one down to start a fight.

Used the external loop to improve on re-usability, and keep the amount of coding down in the individual enemies. The boncas, for instance, use the same call to know when Dink approaches them. The Spike enemies randomly choose to attack or will remain waiting until he gets close.

mlevel.c

"Why not just set &magic to zero..? "

Originally that's what I did, it worked great until I leveled up while form shifted Mlevel works pretty well without having to mess with the level script itself. Been thinking you could even use it for a item only fight, or modify it to create a count down effect.

"You should also be using pseq not seq to return the seq."

Have to take a look at the code to see what you mean.

Thanks for all the suggestions
December 21st 2007, 04:11 AM
fairy.gif
Someone
Peasant He/Him Australia
 
The problem with mlevel is that with a loop with a small wait time you basically condemn everything to be delayed by the time it takes to execute the loop. It's not very long, but there's a way to do without a loop. Also almost all of the time &magic_level is going to be zero so it's a lot of useless CPU calculations.

Similar effect with the sleeping enemies loops. There's a 400ms wait, but there could be several of them. The problem with external() is that it evokes the loading of the script file being called into memory. Yes the scripts are never very big but even just the hard drive access delay is non-trivial, so if you've got several external() being run every second you'll run into problems with stuff being delayed. So there's potential problems with sprites or the midi stuttering.

I mean change sp_seq(&missile_target,-1) to sp_pseq(&missile_target,-1) because pseq is more reliable to get the sequence.