Disco Marines

From Staredit Network Wiki
Revision as of 15:44, 24 November 2012 by DevliN (Talk | contribs) (Created page with 'Tutorial by: Lord_Agamemnon ==Requirements== *DatEdit *IceCC ==Tutorial== This tutorial will teach you some more advanced iscripting techniques that modders use and som…')

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Tutorial by: Lord_Agamemnon

Requirements

Tutorial

This tutorial will teach you some more advanced iscripting techniques that modders use and some codes that will be very useful for neat effects.

First, let's do the DatEdit part.

THE DATEDIT PART

  1. Go into weapons.dat. Find Gauss Rifle1(Unused), ID 117.
  2. Change its behavior to "Attack & Self-destruct".
  3. Change its graphic to "White Circle (Invisible)".
  4. Change its explosion to "Splash (Radial)" and make the splash radii 20/40/80.
  5. Make it deal a large amount of damage, say, 100.
  6. Save weapons.dat in your mod folder.

What we just did: We modified an unused weapon to be a suicide attack with large splash.

THE ISCRIPT PART

Note: I will use ICECC 1.3 code for this section. It is not exactly like 1.1, which is what most people use, but it does resemble it.

  1. Decompile iscript.bin and open the text file. Find the Marine's iscript.
  2. Add the following line after the line "MarineGndAttkInit:" in the code
trgtrangecondjmp  32 ExplodingMarine 

What we just did: trgtrangecondjmp will made the Marine go to the code block "ExplodingMarine" if its target is within 32 pixels. 1 weapons.dat range unit = 16 pixels.

Add the following block of code somewhere in the Marine's iscript as a separate routine:

ExplodingMarine:
nobrkcodestart
setvertpos -16
wait 1
setvertpos -24
wait 1
setvertpos -28
wait 1
setvertpos -30
wait 1
setvertpos -31
wait 1
setvertpos -30
wait 1
setvertpos -28
wait 1
setvertpos -24
wait 1
setvertpos -16
wait 1
setvertpos 0
wait 1
setvertpos -16
wait 1
setvertpos -24
wait 1
setvertpos -28
wait 1
setvertpos -30
wait 1
setvertpos -31
wait 1
setvertpos -30
wait 1
setvertpos -28
wait 1
setvertpos -24
wait 1
setvertpos -16
wait 1
setvertpos 0
wait 1 

What we just did: So far, this block of code will make the Marine leap into the air twice. setvertpos moves the graphic to # units down from its original position. The nobrkcodestart means that once this starts, the Marine cannot receive orders. But this isn't that great; let's add some more.

Add the following after that previous code:

imgol 332 0 0
turncwise 2
wait 1
turncwise 2
wait 1
turncwise 2
wait 1
turncwise 2
wait 1
turncwise 2
wait 1
turncwise 2
wait 1
turncwise 2
wait 1
turncwise 2
wait 1
turncwise 2
wait 1
turncwise 2
wait 1
turncwise 2
wait 1
turncwise 2
wait 1
turncwise 2
wait 1
turncwise 2
wait 1
turncwise 2
wait 1
turncwise 2
wait 1
imgol 332 0 0
turncwise 2
wait 1
turncwise 2
wait 1 
turncwise 2
wait 1
turncwise 2
wait 1
turncwise 2
wait 1
turncwise 2
wait 1
turncwise 2
wait 1
turncwise 2
wait 1
turncwise 2
wait 1
turncwise 2
wait 1
turncwise 2
wait 1
turncwise 2
wait 1
turncwise 2
wait 1
turncwise 2
wait 1
turncwise 2
wait 1
turncwise 2
wait 1 

What we just did: Whew, that was long. The "imgol" will display an orange explosion on top of the Marine, since images.dat ID 332 is the small orange explosion. "turncwise" and its cousin I'm not using here "turnccwise" turn the graphic # units in the indicated direction (cwise = clockwise, ccwise = counterclockwise). 32 units make up a circle. So the Marine will spin twice.

We're not done yet, though.

After that big mother of code, add these five lines:

sprol 267 0 0
useweapon 117
nobrkcodeend
gotorepeatattk
goto MarineGndAttkToIdle 

What we just did: The sprol here acts like imgol, except that sprols won't follow their parent image around (read: they're stuck in place) and they won't go away if the parent dies; 267 is the Sprites.dat ID of the nuclear explosion. useweapon command the unit to, well, use a specific weapon, in this case Gauss Rifle1(Unused) that we modified earlier. nobrkcodeend ends the section begun by nobrkcodestart, and gotorepeatattk and goto are fairly self-explanatory and simple.

So all in all, this script will make the Marine bounce twice, spin twice with explosions, and then nuke himself.

Once you have all that in your code block, save, compile, and put the iscript.bin into you mod folder under the \scripts path.

MPQify it and run.

Get a Marine right next to something and watch the carnage!