Author
|
Topic: help with spells/weapons
|
FF4LIFE |
posted 09-28- 10:02 PM CT (US)
Is there a way to say void hit with only an item or only magic? Like: void hit item(void) or something like that? Because I'm going to have certain spells and weapons do specail things to sprites when they hit them by under void hit checking what item they have. BUT, if you have the right item and hit them with magic it still triggers it. Is there a good way around this?thanks
|
Sphinx
|
posted 09-29- 11:45 PM CT (US)
Yeah, use the same idea as the fireball and the burning tree... check out these scripts item-fb & s2-sec1 & dam-fire. |
Unthinkable
|
posted 10-01- 05:33 AM CT (US)
Use a script under the hit section that checks the current weapon script and reacts acordinglyint compare_weapon( char name_of_item_script) Example: compare_weapon("ITEM-B1"); would return 1 if the armed item's script was item-b1. Used in s3-gobg.c. works like compare_magic()
|
Unthinkable
|
posted 10-01- 05:40 AM CT (US)
Download the DinkC help, from dink.telefragged.com"Dink C Help Revision 2" http://www.3ddownloads.com/showfile.php3?file_id=29662 It has a wealth of informaton on command usage.
|
Nexis
|
posted 10-01- 04:30 PM CT (US)
Sphinx's idea sounds good...now can anyone figure out where I neglected to do this check in Prophecy? |
FF4LIFE
|
posted 10-01- 07:11 PM CT (US)
Yeah, i've thought of that, and thats why i asked the first question. You see, if I have a sword and when you attack a tree, under the tree's void hit it looks for the sword and finds it. Thats all good, right? BUT, if you equip a magic, and hit the tree, it looks for the sword and finds it, but you didn't even hit it with the sword. So i'll have to attach a script to the certain weapons like dam-a, right? How whould I do that with a sword, or your fists? |
FF4LIFE
|
posted 10-10- 10:11 PM CT (US)
Uh, i like the idea of having it like the trees, but how do i check for a certain script within the tree script or whatever? I mean, I can make it run dam-fire or whatever, but in the script its hitting how do I check for it? |
Sphinx
|
posted 10-12- 02:42 AM CT (US)
Okay, I think I need to get into specifics FF4LIFE, feel free to e-mail me at smorton1@home.com - I hope I can help. |
someone2
|
posted 10-12- 03:39 AM CT (US)
If you want to find out if it was Dink who attached the tree with a sword, or a fireball, check &enemy_sprite.ie: -- void hit(void) { int &ebrain = sp_brain(&enemy_sprite); if (&ebrain == 1) { //it is Dink int &weap = compare_weapon("sword"); if (&weap == 1) //dink hit the tree while armed with sword.c } if (&ebrain == 1) { //it is a missile int &mag = compare_magic("fireball"); //etc etc.. } } --- I don't know what will happen if you try to hit the tree with a arrow, though. |
someone2
|
posted 10-12- 03:41 AM CT (US)
Uh.. that should be:&ebrain = sp_brain(&enemy_sprite,-1); |
FF4LIFE
|
posted 10-12- 05:40 PM CT (US)
The big problem is though, if you are equiped with the sword and hit it with a magic spell, you're holding the sword, so it thinks you used it. However, I know how to attach a dam-fire or whatver spell to an arrow, but how do I check under the enemy script for that particular script, like the trees burning. |