Need some help at iscript

Post Reply
User avatar
DoomerMrT
Terran Supply Depot Clerk
Terran Supply Depot Clerk
Posts: 18
Joined: Thu Jan 01, 2009 8:52 am
Location: Hungary

Need some help at iscript

Post by DoomerMrT »

Hello!

I am having some problems at converting the corsair into a carrier stiled ship. I just want to make it to look like a carrier, and use a custom attack. I've become familiar with DatEdit. I have a custom grp file named corsair.grp, and my units, weapons, flingy, sprites and images.dat file. I've put them into an mpq file, then made a self-executing stuff from it. After thousands of tryings and crashes, I've realized that I may need more than DatEdit, and run into IceCC and iscript.bin. I've modified it for my needs, but every time when I want to attack with the ship, it just attacks once, then stops, but then it's still have the attack button highlighted, and keeps following it's target without actually shooting it. After some time the game crashes. Also note that the missile doesn't show up.

iscript code:

Spoiler
# ----------------------------------------------------------------------------- #
# This header is used by images.dat entries:
# 929 Corsair (protoss\corsair.grp)
.headerstart
IsId          369
Type          21
Init          CorsairInit
Death          CorsairDeath
GndAttkInit    CorsairGndAttkInit
AirAttkInit    CorsairAirAttkInit
Unused1        [NONE]
GndAttkRpt    CorsairGndAttkRpt
AirAttkRpt    CorsairAirAttkRpt
CastSpell      CorsairCastSpell
GndAttkToIdle  CorsairGndAttkToIdle
AirAttkToIdle  CorsairGndAttkToIdle
Unused2        [NONE]
Walking        CorsairWalking
WalkingToIdle  CorsairGndAttkToIdle
SpecialState1  [NONE]
SpecialState2  [NONE]
AlmostBuilt    [NONE]
Built          [NONE]
Landing        [NONE]
LiftOff        [NONE]
IsWorking      [NONE]
WorkingToIdle  [NONE]
WarpIn        CorsairWarpIn
.headerend
# ----------------------------------------------------------------------------- #

CorsairInit:
imgul          930 0 42 # CorsairShad (protoss\corsair.grp)
CorsairGndAttkToIdle:
playfram      0x00 # frame set 0
goto          CorsairLocal00

CorsairLocal00:
playfram      0x11 # frame set 1
setvertpos    1
waitrand      8 10
playfram      0x22 # frame set 2
setvertpos    2
waitrand      8 10
setvertpos    1
playfram      0x11 # frame set 1
waitrand      8 10
setvertpos    0
playfram      0x00 # frame set 0
waitrand      8 10
goto          CorsairLocal00

CorsairDeath:
playsnd        533 # Protoss\Scout\PScDth00.WAV
imgol          215 0 0 # ProtossBuildingExplosionLarge (thingy\tBangX.grp)
wait          5
end           

CorsairGndAttkInit:
playfram      0x11 # frame set 1
wait          1
playfram      0x22 # frame set 2
CorsairGndAttkRpt:
playsnd        1060 # Protoss\Corsair\PCorlasr2.wav
attackwith    2
wait          2
attackwith    1
attackwith    1
wait          2
attackwith    1
attackwith    2
attackwith    1
wait          5
attackwith    1
attackwith    2
wait          1
playfram      0x11 # frame set 1
gotorepeatattk
goto          CorsairGndAttkToIdle

CorsairAirAttkInit:
playfram      0x11 # frame set 1
wait          1
playfram      0x22 # frame set 2
CorsairAirAttkRpt:
playsnd        1060 # Protoss\Corsair\PCorlasr2.wav
attackwith    2
wait          2
attackwith    1
attackwith    1
wait          2
attackwith    1
attackwith    2
attackwith    1
wait          5
attackwith    1
attackwith    2
wait          1
playfram      0x11 # frame set 1
gotorepeatattk
goto          CorsairGndAttkToIdle

CorsairCastSpell:
playfram      0x00 # frame set 0
nobrkcodestart
wait          1
playfram      0x00 # frame set 0
wait          1
playsnd        1059 # Protoss\Corsair\PCorWeb1.wav
castspell     
nobrkcodeend 
gotorepeatattk
sigorder      2
goto          CorsairGndAttkToIdle

CorsairWalking:
imgol          114 0 0 # CarrierGlow (thingy\pcaGlow.grp)
playfram      0x00 # frame set 0
setvertpos    0
goto          CorsairLocal01

CorsairLocal01:
wait          125
goto          CorsairLocal01

CorsairWarpIn:
imgol          143 0 0 # Unknown143 (protoss\scout.grp)
goto          CorsairLocal01


# ----------------------------------------------------------------------------- #
User avatar
Hercanic
Protoss Stargate Concierge
Protoss Stargate Concierge
Posts: 1289
Joined: Sat Aug 19, 2006 12:11 am
Contact:

Re: Need some help at iscript

Post by Hercanic »

Are you using the original Carrier GRP? In your script, you're using at least 3 framesets, and I thought the Carrier only had one frameset.
User avatar
DoomerMrT
Terran Supply Depot Clerk
Terran Supply Depot Clerk
Posts: 18
Joined: Thu Jan 01, 2009 8:52 am
Location: Hungary

Re: Need some help at iscript

Post by DoomerMrT »

I have a custom corsair.grp file with 85 images in it. Anyway perhaps I should get know what does frameset mean  :P
User avatar
Hercanic
Protoss Stargate Concierge
Protoss Stargate Concierge
Posts: 1289
Joined: Sat Aug 19, 2006 12:11 am
Contact:

Re: Need some help at iscript

Post by Hercanic »

A frame is a single image, a frameset is a set of 17 frames, comprising the rotation for one frame of animation.
Post Reply