Crazy Freaky Turret Behavior (Help!)
Posted: Mon Feb 25, 2008 12:42 am
EDIT 2: Well, while my former question hasn't been answered, it's not quite as pressing as my current one, since the former was partially solved, but this one has me stumped. Okay, so: I've been fiddling around in iscript, obviously, as the pictures below demonstrate. I've been further refining the laser battery weapon (Which is currently on the hero Science Vessel - who will not be Magellan - alone, but is an optional add-on for any fleet warship the Terrans may employ in the campaign I'm working on), in order to turn it into less of a rapid-fire laser-scattergun and more of a concentrated stream of laser-y death. With me so far? Coo'.
To this end, I've given the weapon an absurdly short cool-down time - but an attack that is completely ruled by iscript. The weapon is programmed to fire four times in extremely rapid succession, inside of a nobrkcode. However, immediately after the end of the nobrkcode, and before the repeatattk line, it requires between a one-and-one-half-second-to-two-second cooldown. (I've been thinking of extending the nobrkcode to cover that, but it all depends - two seconds when you're unable to move could be devastating if you're overwhelmed by, say, scourges.)
And this was working great - but only while I had 'Attack this 3x3 area' set. Then I moved to 'Fly to target (Don't follow)', and bad things started happening. First off, the fourth attack ceased to launch, the majority of the time - the science vessel would only fire three times, instead of four, and then get stuck in that long cooldown. Sometimes it even only attacked twice - though that seemed to be more when it ran out of targets in its immediate firing-range. So I thought to myself, 'Fine, well, if that's the way you want to play, I'll just work around you!' And so I added an extra 'attack-then-wait' string-combo to the iscript, and lengthened the time between firings.
That worked, sort've. But there were two problems. First, the long lag-time between shots was awkward and unpleasant to deal with. And two, the turret on top of the science vessel detached and floated free from the unit. I've included a screenshot, below the others already posted. For reference, clicking on either the detached, floating turret, the science vessel, or even the air between the two selected the vessel for ordering. And the turret did not move back, no matter what I did. (It still died with the science vessel, however.)
So. Um. Any clues as to what could cause this? I know that it goes away if I remove that extra 'attack' and 'wait' command, but just doing that is sort've unsatisfactory, if the other problem returns. Also, why is it that, if the time between shots is less than seven (With the 'Fly to target, don't follow' option), do shots seem to...blend together? As in, they're fired so rapidly they're treated as one attack. This is all on Fastest game settings, by the way, but I had a '1-10-7-5' (From the very start of the attack) sequence of waits on the old 'scattergun', and all four of the attacks launched. (The last two were pretty close together, admittedly.)
Any assistance would be richly appreciated.
------------------------------------------------------
EDIT: Sorta-kinda fixed the problem. See the post below this one.
Okay. So, I've been doing a lot of .grp, iscript.bin, .dat, .tbl, aiscript.bin, etcetera modification. I've also been playing a lot of games. That's a given. So!
While playing what would otherwise be a regular map (Fall of Kerrigan) on my modified .exe file, I encountered a problem. In the other topic, I mentioned that I gave the vulture a second weapon and a corresponding iscript mod so that he could use it in his regular attacks. Good? Good. It worked great.
For the hero. The hero's the only one that's supposed to have the weapon. The regular vulture does not. I assumed that, since the regular vulture did not possess the weapon, it wouldn't try to use it, and would therefore not trip the 'Playfram' animations that the hero would.
Joke's on me. Not only is the regular vulture trying to use a weapon it doesn't have, it's trying to use it badly.
I have included screenshots below the Magellan-turret screenie. Basically, it's spawning an unselectable control tower over the vulture. This only happens with the regular one, not the hero. My question is: Why? The frames exist for the vulture model, itself. Why, in the name of god, wouldn't it just go through the frame-animation and play the sounds without utilizing the weapon?
And is there any way of ...I dunno, restricting that weapon and its associated sounds and animations to the hero, alone? Mmmph...
OLD POST
---------------------------------------------------------------------------------------
The topic title is actually a little misleading. Scmdraft2 has no difficulty whatsoever in actually telling me that units are equipped with a certain weapon - in this case, it's a converted Science Vessel Hero with a set of ground/air-firing laser batteries, custom weapons built off of an unused weapons.dat entry. They work just fine - my science vessel cheerfully goes along firing its laser batteries at enemies below and above, and (somehow) I even managed to get the flingy of the laser-blast to materialize in the right place (Underneath the ship for the ground attack, and from the top-turret for the air attack). There's just one problem...
It deals zero damage. Now, this isn't always the case - when I set the unit to 'Use Unit Defaults', it reverts back to its proper damage (16, in this case.) But, unfortunately, my science vessel hero is not Magellan, nor does he have 800 health, or zero armor. Thusly, the 'Use default' option is as good as removing the unit from the map entirely - because it'd just look odd to have a Magellan floating around in the midst of everything else that is happening.
Now, it is a sneaking suspicion of mine that something about Staredit/Starforge/etcetera makes it unable to modify the weapon-damage of any non-natural weapon. My question pertains to whether I'm right about this, and, regardless of whether I am or not, if there's any way to get around this annoying little bug. Would packing an updated weapons.tbl file into the map allow it to recognize and alter new weapons, or...no?
EDIT: Just to make it clear. My modified iscript.bin has given the science vessel a functional attack, it uses it. It uses its weapon properly. Scmdraft 2.0 (When loaded with my mod MPQ) shows the weapon, but refuses to allow me to change it's damage or upgrade-increment. Insomuch as any change I make is immediately undone - to that weapon's damage or upgrade stats. Also: Is the SCV's fusion-cutter "0" upgrade hard-coded? I switched out the Fusion Cutter and my new weapon (as a temporary fix) and while I had a weapon that dealt damage, I couldn't change the amount of damage it gained while upgrading (It was stuck at '0'.)
EDIT 1.5: Incidentally, I did set the Fusion Cutter to use Terran Ship Weapon upgrades, in the preceding case, not Unknown60.
EDIT 2: Added screenshots to help demonstrate the problem - taken from the final map of the initial Enslavers campaign. As you can see, the laser-battery weapon works fine when equipped to the base Magellan. But when that 'Use Default Settings' thing is unchecked, it automatically resets the damage to zero. I know it's possible to add new, changeable weapon-data to the registry - I saw it done while looking through the Vision 2 coding, Serena Schezar's weapon maintained its damage and could be altered, even when listed as a "Terran Heavy Valkyrie".
Incidentally, for those curious as to what is happening in the screenies, the Science Vessel is attacking a total of four times with its 3x3-spread (Factor-two) laser battery, at steadily-increasing increments (So that the second shot comes faster than the first, the third faster than the second, and so on.) It's very rough (And, at a base-32 damage thanks to the two-times-16 offered by the factor of two, a little overpowered) but I did the iscripting in about thirty seconds, so, sue me. Also, big thanks to IskatuMesk/Doctor Doack for all of the iscript information he provided, here and at Maplantis.
EDIT 3(AKA, "Goddamn it, how much more do you have to say?!"): Also, I realize this is more of a laser scattergun than a laser battery right now. That is going to change. Eventually. Right now, I'm having too much fun blasting through Enslavers 3b with a single science vessel. Uwee-hee.
EDIT 4: Sorry about that. Turns out that I got the original version of SCMDraft 2, which had a debug error involving damage-changing. I've fixed it now and everything is working fine. Ehe. Feel free to lock this topic, now. Though I may end up posting updates in it. Or not. Whatever works.
To this end, I've given the weapon an absurdly short cool-down time - but an attack that is completely ruled by iscript. The weapon is programmed to fire four times in extremely rapid succession, inside of a nobrkcode. However, immediately after the end of the nobrkcode, and before the repeatattk line, it requires between a one-and-one-half-second-to-two-second cooldown. (I've been thinking of extending the nobrkcode to cover that, but it all depends - two seconds when you're unable to move could be devastating if you're overwhelmed by, say, scourges.)
And this was working great - but only while I had 'Attack this 3x3 area' set. Then I moved to 'Fly to target (Don't follow)', and bad things started happening. First off, the fourth attack ceased to launch, the majority of the time - the science vessel would only fire three times, instead of four, and then get stuck in that long cooldown. Sometimes it even only attacked twice - though that seemed to be more when it ran out of targets in its immediate firing-range. So I thought to myself, 'Fine, well, if that's the way you want to play, I'll just work around you!' And so I added an extra 'attack-then-wait' string-combo to the iscript, and lengthened the time between firings.
That worked, sort've. But there were two problems. First, the long lag-time between shots was awkward and unpleasant to deal with. And two, the turret on top of the science vessel detached and floated free from the unit. I've included a screenshot, below the others already posted. For reference, clicking on either the detached, floating turret, the science vessel, or even the air between the two selected the vessel for ordering. And the turret did not move back, no matter what I did. (It still died with the science vessel, however.)
So. Um. Any clues as to what could cause this? I know that it goes away if I remove that extra 'attack' and 'wait' command, but just doing that is sort've unsatisfactory, if the other problem returns. Also, why is it that, if the time between shots is less than seven (With the 'Fly to target, don't follow' option), do shots seem to...blend together? As in, they're fired so rapidly they're treated as one attack. This is all on Fastest game settings, by the way, but I had a '1-10-7-5' (From the very start of the attack) sequence of waits on the old 'scattergun', and all four of the attacks launched. (The last two were pretty close together, admittedly.)
Any assistance would be richly appreciated.
------------------------------------------------------
EDIT: Sorta-kinda fixed the problem. See the post below this one.
Okay. So, I've been doing a lot of .grp, iscript.bin, .dat, .tbl, aiscript.bin, etcetera modification. I've also been playing a lot of games. That's a given. So!
While playing what would otherwise be a regular map (Fall of Kerrigan) on my modified .exe file, I encountered a problem. In the other topic, I mentioned that I gave the vulture a second weapon and a corresponding iscript mod so that he could use it in his regular attacks. Good? Good. It worked great.
For the hero. The hero's the only one that's supposed to have the weapon. The regular vulture does not. I assumed that, since the regular vulture did not possess the weapon, it wouldn't try to use it, and would therefore not trip the 'Playfram' animations that the hero would.
Joke's on me. Not only is the regular vulture trying to use a weapon it doesn't have, it's trying to use it badly.
I have included screenshots below the Magellan-turret screenie. Basically, it's spawning an unselectable control tower over the vulture. This only happens with the regular one, not the hero. My question is: Why? The frames exist for the vulture model, itself. Why, in the name of god, wouldn't it just go through the frame-animation and play the sounds without utilizing the weapon?
And is there any way of ...I dunno, restricting that weapon and its associated sounds and animations to the hero, alone? Mmmph...
OLD POST
---------------------------------------------------------------------------------------
The topic title is actually a little misleading. Scmdraft2 has no difficulty whatsoever in actually telling me that units are equipped with a certain weapon - in this case, it's a converted Science Vessel Hero with a set of ground/air-firing laser batteries, custom weapons built off of an unused weapons.dat entry. They work just fine - my science vessel cheerfully goes along firing its laser batteries at enemies below and above, and (somehow) I even managed to get the flingy of the laser-blast to materialize in the right place (Underneath the ship for the ground attack, and from the top-turret for the air attack). There's just one problem...
It deals zero damage. Now, this isn't always the case - when I set the unit to 'Use Unit Defaults', it reverts back to its proper damage (16, in this case.) But, unfortunately, my science vessel hero is not Magellan, nor does he have 800 health, or zero armor. Thusly, the 'Use default' option is as good as removing the unit from the map entirely - because it'd just look odd to have a Magellan floating around in the midst of everything else that is happening.
Now, it is a sneaking suspicion of mine that something about Staredit/Starforge/etcetera makes it unable to modify the weapon-damage of any non-natural weapon. My question pertains to whether I'm right about this, and, regardless of whether I am or not, if there's any way to get around this annoying little bug. Would packing an updated weapons.tbl file into the map allow it to recognize and alter new weapons, or...no?
EDIT: Just to make it clear. My modified iscript.bin has given the science vessel a functional attack, it uses it. It uses its weapon properly. Scmdraft 2.0 (When loaded with my mod MPQ) shows the weapon, but refuses to allow me to change it's damage or upgrade-increment. Insomuch as any change I make is immediately undone - to that weapon's damage or upgrade stats. Also: Is the SCV's fusion-cutter "0" upgrade hard-coded? I switched out the Fusion Cutter and my new weapon (as a temporary fix) and while I had a weapon that dealt damage, I couldn't change the amount of damage it gained while upgrading (It was stuck at '0'.)
EDIT 1.5: Incidentally, I did set the Fusion Cutter to use Terran Ship Weapon upgrades, in the preceding case, not Unknown60.
EDIT 2: Added screenshots to help demonstrate the problem - taken from the final map of the initial Enslavers campaign. As you can see, the laser-battery weapon works fine when equipped to the base Magellan. But when that 'Use Default Settings' thing is unchecked, it automatically resets the damage to zero. I know it's possible to add new, changeable weapon-data to the registry - I saw it done while looking through the Vision 2 coding, Serena Schezar's weapon maintained its damage and could be altered, even when listed as a "Terran Heavy Valkyrie".
Incidentally, for those curious as to what is happening in the screenies, the Science Vessel is attacking a total of four times with its 3x3-spread (Factor-two) laser battery, at steadily-increasing increments (So that the second shot comes faster than the first, the third faster than the second, and so on.) It's very rough (And, at a base-32 damage thanks to the two-times-16 offered by the factor of two, a little overpowered) but I did the iscripting in about thirty seconds, so, sue me. Also, big thanks to IskatuMesk/Doctor Doack for all of the iscript information he provided, here and at Maplantis.
EDIT 3(AKA, "Goddamn it, how much more do you have to say?!"): Also, I realize this is more of a laser scattergun than a laser battery right now. That is going to change. Eventually. Right now, I'm having too much fun blasting through Enslavers 3b with a single science vessel. Uwee-hee.
EDIT 4: Sorry about that. Turns out that I got the original version of SCMDraft 2, which had a debug error involving damage-changing. I've fixed it now and everything is working fine. Ehe. Feel free to lock this topic, now. Though I may end up posting updates in it. Or not. Whatever works.