Staredit Network

Staredit Network -> Modding Assistance -> Iscript/flingy problem
Report, edit, etc...Posted by Lord_Agamemnon(MM) on 2006-08-30 at 15:31:33
I want to make Consume fly to its target while still using the same graphic. So I go to the iscript. I make "Consume" type 2 and add a GndAttkInit routine, which I reference in the header. Here's the entry:

CODE
# ----------------------------------------------------------------------------- #
# This header is used by images.dat entries:
# 517 Consume (thingy\consume.grp)
.headerstart
IsId            298
Type            2
Init            ConsumeInit
Death           ConsumeDeath
GndAttkInit     ConsumeGndAttkInit
AirAttkInit     [NONE]
.headerend
# ----------------------------------------------------------------------------- #

ConsumeInit:
playfram        0x00 # frame set 0
wait  1
sigorder 1
wait  1
goto  ConsumeGndAttkInit

ConsumeGndAttkInit:
wait  125
goto  ConsumeGndAttkInit

ConsumeDeath:
domissiledmg
wait            1
end            


And to let it fly around, I change its flingy.dat entry. I add properties for "Turn radius" and whatnot and set movement control to "Partially Mobile (Weapon)" since that's what the other weapon sprites use. I look through the other tabs--"Use full iscript" is checked, so I leave that.

Anyway, I let this thing go. Everything works grand, except that it always explodes about two feet in front of the spellcaster, and nothing can persuade it to go farther. What's going on?
Report, edit, etc...Posted by BroodKiller on 2006-08-30 at 16:00:01
It has used all its frames for 'turning' I presume. You need to respawn it.
Report, edit, etc...Posted by Lord_Agamemnon(MM) on 2006-08-30 at 17:05:51
What do you mean? I removed the spinning animation, so it shouldn't be hitting an end there. I tried putting "imgol08 517 0 0" at the end of "GndAttkInit" but that just crashed Starcraft.
Report, edit, etc...Posted by BroodKiller on 2006-08-31 at 17:47:49
Duh...ok, let's go through it again: what do you want it to do, precisely?
Report, edit, etc...Posted by TERRAINFIGHTER on 2006-08-31 at 18:12:11
QUOTE(Lord_Agamemnon @ Aug 30 2006, 04:05 PM)
What do you mean?  I removed the spinning animation, so it shouldn't be hitting an end there.  I tried putting "imgol08 517 0 0" at the end of "GndAttkInit" but that just crashed Starcraft.
[right][snapback]553623[/snapback][/right]

That's because your placing a active image overlay, try imgol0e instead.
(I havn't tested that opcode yet, but if I'm correct it's the same thing except it's a independant overlay.)
Report, edit, etc...Posted by Lord_Agamemnon(MM) on 2006-08-31 at 20:26:08
@Broodkiller: I want it to have normal missile behaviors: it flies to its target (well, actually, seeks it, but that's just weapons.dat) and then explodes when it gets there instead of flying in the direction of the target for five feet and exploding randomly.

@TF: I'll try that, but I don't see why it won't act like any other weapon: I think I changed all of the relevant properties...

EDIT: OK, tried it. It just brings SC down in a blaze of glory.
Report, edit, etc...Posted by TERRAINFIGHTER on 2006-08-31 at 21:58:47
Now that I think about it, imgol0e may require a .lol (LO* file) selected in images.dat's Overlay 3... (unsure)

Also, if it doesn't require it, then it should work unless you messed something else up... *asks to view modded files*
Report, edit, etc...Posted by Lord_Agamemnon(MM) on 2006-08-31 at 22:37:13
Would like to, but no can do--this is my modding contest entry. I can make a copy of sorts and post that, so I'll get on it soon.
Report, edit, etc...Posted by Pyro-Fire on 2006-09-01 at 10:10:39
what do you mean by "2 feet" in front of the unit?

if its a couple' of pixels, then you can simply edit it to appear directly on the target (dont ask how) bcuz when u normally cast it, it goes between the defiler and the unit.

if its very far, then copy the same *.dat data from another missile to the consume weapon.

if both above dont work, then edit the .LO* file.
Report, edit, etc...Posted by Lord_Agamemnon(MM) on 2006-09-01 at 11:35:36
@TF: The modified iscript is up there in the first post, and the flingy characterstics are thus:

Sprites File: 363=Consume
Top Speed: 600
Acceleration: 27
Halt distance: 7585
Turn radius: 20
Movement control: Partially mobile, weapon (I tried flingy.dat also, it doesn't change anything)

I left Sprites.dat and images.dat the same. I also tried using a different sprite (Pulse Cannon) for the attack and it worked, so it's something about the specific iscript\flingy here.
Report, edit, etc...Posted by TERRAINFIGHTER on 2006-09-01 at 14:16:12
I think I found your problem...
QUOTE
goto  ConsumeGndAttkInit
goto  ConsumeGndAttkInit

...you need to remove those tongue.gif (I can't believe I didn't notice this earlier crazy.gif )
Report, edit, etc...Posted by Lord_Agamemnon(MM) on 2006-09-01 at 14:35:41
I removed that--no effect. Here's the newest version of the script--I changed a couple things. It's definitely NOT something hardcoded since it works fine with Pulse Cannon as the graphics.

CODE
# ----------------------------------------------------------------------------- #
# This header is used by images.dat entries:
# 517 Consume (thingy\consume.grp)
.headerstart
IsId            298
Type            2
Init                            ConsumeInit
Death           ConsumeDeath
GndAttkInit     ConsumeGndAttkInit
AirAttkInit     [NONE]
.headerend
# ----------------------------------------------------------------------------- #

ConsumeInit:
playfram 0
wait  1
sigorder 1
wait  1
ConsumeGndAttkInit:
wait  125

ConsumeDeath:
domissiledmg
wait            1
end            


There are some imgol08s in there, but that's my own contest secret, y'know. They wouldn't have any effect, anyway--would they?

I don't think the goto ConsumeGndAttkInits were messing it up, since all of the normal weapon sprites have those at the end of Init and GndAttkInit. Like I said, it's only Consume. When I set the graphic to Pulse Cannon, it works fine.


BREAKING NEWS EDIT: It's the flingy. When I copied it for Pulse Cannon, it didn't work. What's wrong with that flingy?
Report, edit, etc...Posted by TERRAINFIGHTER on 2006-09-01 at 14:46:42
The extra imgol's could very well be causing it, try removing them to test it.


Also, I'd sugguest you change that you try to copy a regular missile flying, example:
• remove the wait after the sigorder
• add a loop to the GndAttkInit, by adding a goto ConsumeGndAttkInit (probably why it's stopping, as it can't loop to fly)

Edit: the flingy isn't the problem, try what I said above this. tongue.gif (the pulse cannon just can't work with the sprites/images.dat)
Report, edit, etc...Posted by Lord_Agamemnon(MM) on 2006-09-01 at 15:42:25
Adding loop: That was in there before and didn't seem to be working. I put it back, and it does nothing.

Removing wait: Nope, it's not that.

Removing imgol08s: Not that either.

Pulse cannon: It was using its original sprites.dat entry. I gave it the flingy properties described above, except that I left its sprite file as 336 = Pulse Cannon. It acted the same way as Consume. So I do think it's the flingy, as the Pulse Cannon was default on everything else.
Report, edit, etc...Posted by BroodKiller on 2006-09-01 at 15:43:46
I wonder - do you want it to play the swirly animation while flying to the target or just move to it statically?
Report, edit, etc...Posted by Lord_Agamemnon(MM) on 2006-09-01 at 15:44:22
Move statically.
Report, edit, etc...Posted by BroodKiller on 2006-09-01 at 15:47:09
Checked images.dat flags, just in case?
Report, edit, etc...Posted by Lord_Agamemnon(MM) on 2006-09-01 at 15:49:53
Yep. "Floats" and "Use Full Iscript" are checked.
Report, edit, etc...Posted by BroodKiller on 2006-09-01 at 15:51:57
How about the Pulse Cannon's images.dat entry?
Report, edit, etc...Posted by Lord_Agamemnon(MM) on 2006-09-01 at 15:56:07
Same, except that gfx turns is also checked. Like I said, the pulse cannon works unless I change Top Speed, Acceleration, Halt Distance and Turn Radius to Consume's. (600, 27, 7585, and 20, respectively.)
Report, edit, etc...Posted by BroodKiller on 2006-09-01 at 15:58:47
I don't think it should have Turn Radius higher than 1 if it 'flies'. Check 'em all against Pulse Cannon's - one at a time, to figure out the bug.
Report, edit, etc...Posted by Lord_Agamemnon(MM) on 2006-09-01 at 16:04:14
Pulse Cannon's defaults:
Top Speed: 21333 (but flingys can have small values; the two lowest defaults are 640 (BCruiser) and 213 (Overlord))
Acceleration: 850
Halt Distance: 267704 I tried adding a "0" onto the end of Consume's, to see if it would help. No, it didn't.
Turn Radius: 127. Most of them seem to be 13, 40, or 127. Let's try those and see if it works.

Note: I kind of copied the values from the Battlecruiser and changed them a bit...

EDIT: Tried 13 and 40, neither of them worked. 127 seems to be for fast weapon sprites, which this is NOT meant to be.
Report, edit, etc...Posted by BSTRhino on 2006-09-16 at 21:18:27
Sorry to revive this thread but I don't think it's appropriate for me to start a new topic in this case. Just wondering if you worked this one out already? I just had an idea about a solution.

Your consume script at the top was completely 100% correct, use that, I used the same kind of thing in Zerg Doom. My guess is you need to change the halt distance to 6667.

The formula for calculating halt distance is ((speed ^ 2) / (2 * acceleration)) (check http://www.warboards.org/showpost.php?p=299993&postcount=9 for my original explanation.) When I first worked it out, like I said in that original post, I figured that StarCraft would never let a unit stop prematurely, but I guess I was wrong. Your consume starts slowing down at a distance of 7000, while it shouldn't start slowing down until 6667, which could explain why it stops before it should.
Next Page (1)