Melee attack artifacts never vanish? Self-attacks odd?

A forum for discussing map making ideas and problems for the Myth series.
User avatar
Baak
Posts: 1109
Joined: Sat Mar 20, 2004 6:26 pm
Location: Mything

Melee attack artifacts never vanish? Self-attacks odd?

Post by Baak »

I'm working on my "WWII Anywhere" plugin and this one is definitely a little more involved...

One oddity I just encountered that appears to be a bug is as follows:
  • I've created a MedKit projectile with associated artifact
  • The artifact overwrites the mons special attack with a MedKit "heal" attack - this is a melee attack like the journeyman healing
  • The artifact starts with 1 charge
  • I have the "Vanishes after final charge" checkbox checked in the artifact
  • I can pick up the projectile/artifact and do the healing, but the artifact never vanishes! I just keep healing and healing and healing...
I've triple-checked all of the above. I have similar projectile/artifacts for RPG's and incindery grenades, and these both work perfectly.

If I T-click the ground (i.e. not myself) with the MedKit artifact, it vanishes from my inventory but I never see it (because it's healing the ground). So it appears to be a problem with "attacking myself".

Also, when I change the MedKit to a non-"Melee attack", it does vanish, but unfortunately in this case the solder tosses the MedKit! ;)

The only solution I can think of is to make a new monster that has the MedKit special attack built-in, and make the artifact overwrite the standard soldier. This should work, but I thought I should bring the above to everyone's attention.


Another tiny oddity I notice that may be related is with the RPG as an artifact. When I "attack myself" (to z00k), instead of using the attack projectile as it should, it uses the original projectile of the RPG on the ground! So instead of a nice "in flight" RPG, it looks like I'm tossing the RPG like a Frisbee (it rotates and is large with no contrail).

Something is amiss... :?
User avatar
Baak
Posts: 1109
Joined: Sat Mar 20, 2004 6:26 pm
Location: Mything

Post by Baak »

Well, I've been messing with this for hours now and there is definitely something wrong.

Seems to be the following:

If an artifact "attack" is self-inflicted (being able to attack friendlies and you attack yourself), odd things happen:

* For non-healing attack (I only have one example of this right now - the WWII RPG as artifact), the original artifact projectile is used during the attack and not the projectile listed in the artifacts attack window. Thus in this case it's like tossing the ammo version of the RPG at the enemy when you click on yourself to "zook". The fix here is to simply remove "can attack friendly units", although it appears if clicking the ground at very close range (which is less than the allowed attack range). Personally, I don't like the zook attack so removing it is OK.

* For a healing attack, the # of charges does not decrease! Thus the artifact never vanishes (if using that checkbox). Testing with 2+ charges shows the charge number doesn't change. As soon as you use the attack on someone else or the ground, the # of charges does decrease as it should.

* In addition for the healing attack, putting a timeout on the artifact (vanishes after X seconds) makes the artifact disappear instantly! You can see it appear in the status bar for a split second. I tried 30, 60, 900, 10000 seconds and it all behaved the same. I tried -60 and the artifact stayed forever.



I also tried having the artifact override the monster and made the monster use the medkit as ammo. Still doesn't work because it never reverts to the original monster due to the fact that the charge never decreases...

Looks like I'm just going to have to leave the medkits out of this plugin. Otherwise you can carry one and keep healing forever (although you wouldn't be able to use any grenades). Too bad there isn't a way to have an item automatically heal the unit just by picking it up.
User avatar
Baak
Posts: 1109
Joined: Sat Mar 20, 2004 6:26 pm
Location: Mything

Post by Baak »

Is there a way now to do attacks that inflict "negative damage" ?

I'm wondering if that might be a workaround - a non-healing attack that heals. Only problem would be not using the healing effects, which might render it unusable, but at least I could test it to narrow things down further.
User avatar
haravikk
Site Admin
Posts: 987
Joined: Mon Mar 22, 2004 12:56 pm
Location: Scotland

Post by haravikk »

Baak wrote:Is there a way now to do attacks that inflict "negative damage" ?
Just enter a negative value for damage, or enter a type of damage that the unit in question has a negative resitence to in their object tag.

This all sounds weird though, I could have sworn I've seen it work fine before, how do the WW2 med-kits work? Have you made sure that the over-riding attack is both a special attack and a primary attack as self-inflicted, non-reflexive attacks tend to be?
Being Haravikk gets you girls like these:
Image
cyan21
Posts: 13
Joined: Thu May 10, 2007 7:32 am

Hmm.

Post by cyan21 »

Contact me on AIM so you can send me the local folder, and I'll see if I can tweak it.

Cyan Ian or JLA 12W3 are my screen names.
User avatar
Roadwyrm
Posts: 37
Joined: Fri Mar 30, 2007 10:50 pm

Post by Roadwyrm »

I recall haveing that issue aswell once...I dont recall what I did to fix it but in one mod I gave it a tiny radius effect and that worked (non-mellee). Ill have to get back into fear...its been years.
Image
User avatar
Baak
Posts: 1109
Joined: Sat Mar 20, 2004 6:26 pm
Location: Mything

Post by Baak »

Thanks for the feedback guys, it is indeed weird.

Haravikk: I thought about checking for "Primary Attack" as I was going to sleep (this is one of those problems now dwelling in my subconscious!) - I'll try that out. I'll also play with the negative damage as described.

Cyan21: Thanks for the offer - I'll try banging on it some more, and if I ultimately give up, I'll pass it by you.

Roadwyrm: I also thought about this last night when thinking about how to make it a non-melee healing attack. I'm going to see if Primary Attack makes a diff and then try this next.


What I discovered when opening up the WWII tagset to build this puppy is the RPG and Medkits (among other things) start off as scenery, which seems to get around these problems. It's odd, because the more I look at the details of it the more I wonder how it works! I notice the original artifacts don't even have "Overrides Owner Attack" checked. It's all very funky and was getting funkier the later I worked on it. At 2am last night I was starting to hallucinate tags... :shock:

Basically I have everything working except this Medkit thing. Will be playing with it now and will keep you posted on progress.
User avatar
Baak
Posts: 1109
Joined: Sat Mar 20, 2004 6:26 pm
Location: Mything

Post by Baak »

Ok - I've gone through a bunch of permutations and tried all the suggestions.

Basically, there is something whacked with the artifact's projectile when it's a "Healing" attack used on yourself. It simply will *not* decrease the number of charges. I am surprised this hasn't been found before?

Using a melee attack and making it negative damage works fine, it just looks odd without the healing sequence (it's much faster).


If anyone wants to repeat this problem, I suggest making a simple projectile/artifact you can put on a map and have the artifact override the mons attack with a healing attack of 0 to 3 range that can be used against friendly units. Give the artifact one charge and have it "vanish after all charges used". See if it works.

This way if you *can* make one that works I can reverse engineer it's simplicity and apply it to my plugin. :)

Seems so odd to me that no one has encountered this problem before...
User avatar
Baak
Posts: 1109
Joined: Sat Mar 20, 2004 6:26 pm
Location: Mything

Post by Baak »

I've done another test and it's definitely a quirk/bug. :?

I've created a zip of a very simple example with instructions on how to test it yourself:


* Journeyman roots are now artifacts that any unit can pick up and use to heal themselves or someone else. When self-healing, you'll notice the charge does not decrease, but healing others works fine.

Instructions on how to test it yourself:
  1. Move everything out of your local folder and unzip the contents of this file into it. It contains an artifacts folder with the artifact and a projectiles folder with the modified projectile.
  2. Run Gimble and have a Warrior go pick up a root (there are a few on the maps near every start).
  3. Be sure your status bar is up. Have him heal himself using the new special attack. You'll see he can do this forever.
  4. Have him heal a buddy and notice it works fine, decreasing the charge on the artifact and making it disappear.
If someone can figure out how to make this work properly I'd be very happy, but I believe it may be a bug. :(
User avatar
Khadrelt
Posts: 479
Joined: Tue Aug 29, 2006 2:59 pm
Location: Utah, USA
Contact:

Post by Khadrelt »

Whether or not the attack is 'healing' doesn't seem to be the issue.

I set the damage type to 'explosion' instead, and it STILL didn't subtract from the charge when self-inflicted, whether the damage was positive or negative.

I then gave the attack a radius and checked 'Area of Effect,' and it worked fine, with both the Explosion and the Healing damage types. Roadwyrm was right - there evidently has to be a radius and an Area of Effect checked.

The radius seems to have to coincide with the size of the unit, too. A .4 radius allowed the Dwarf to heal himself, but Warriors could not - and the Dwarf could not heal Warriors, but the Warrior could heal the Dwarf. Bumping it up to .6 allowed the Warriors to heal themselves without also healing units standing next to them. Trow required a higher radius.
The cake is a lie.
User avatar
Baak
Posts: 1109
Joined: Sat Mar 20, 2004 6:26 pm
Location: Mything

Post by Baak »

Interesting! And could you heal a different unit too (i.e. not yourself)?

I couldn't get the area of effect healing to work two different times I tried before. I'll try it again (might have had melee attack off or something).

I've been doing a negative damage variant which works great and might go with that *if* I can get the right effects going.



Oh, and just as a sanity check, I ran Gimble using the WWII Units 1.1 tagset and picking up the journeyman roots converted to medkits does *not* work! Pretty sure this worked once upon a time. But, if you add the scenery medkits to a map, they *do* work. :shock:
User avatar
Baak
Posts: 1109
Joined: Sat Mar 20, 2004 6:26 pm
Location: Mything

Post by Baak »

I can't get it to work right. :(


Either you can heal yourself and the count decreases, but then you can't heal another unit - or you can heal yourself and the count doesn't decrease and you can heal another unit.


If you can get it to work like so (with the attack radius of 0 to 3 in the artifact attack window):

* You can heal yourself and the count decreases
* You can heal other units and the count decreases


then post a local folder for me please! :)
User avatar
Khadrelt
Posts: 479
Joined: Tue Aug 29, 2006 2:59 pm
Location: Utah, USA
Contact:

Post by Khadrelt »

I could heal myself and others.

All you have to do is open the Journeyman Healing projectile, give the attack a radius (one that's big enough for the unit in question - try 1 just to make sure it works), check 'Area of Effect,' and you're good to go.

I also set the Rate of Expansion to 1, but I don't know if other numbers would affect things, I didn't mess around with that.

The problem is getting a radius big enough to affect the units but small enough that it doesn't also heal anything near it. If all the units are close to the same size you should be able to come up with a good number.
The cake is a lie.
User avatar
Baak
Posts: 1109
Joined: Sat Mar 20, 2004 6:26 pm
Location: Mything

Post by Baak »

Khadrelt wrote:I could heal myself and others.

All you have to do is open the Journeyman Healing projectile, give the attack a radius (one that's big enough for the unit in question - try 1 just to make sure it works), check 'Area of Effect,' and you're good to go.
And you're doing this with an artifact involved, right? :)
User avatar
ozone
Posts: 744
Joined: Wed Mar 24, 2004 5:05 pm

Post by ozone »

I have it working in SF2...

maybe you want to check my tags out?

---------------------------------------------------

BTW:Medkits and RPGS are scenery in ww2...
do it.
Post Reply