Site  •  Wiki  •  FAQ  •  Register  •  Login

two of the same attacks?

<<

shadow649

Posts: 1

Joined: June 21st, 2010, 5:16 pm

Post June 24th, 2010, 1:59 pm

two of the same attacks?

I've seen two types of ground attacks in starcraft team fortress and I'm wondering how you can do that. For example say I wanted a Marine with a bayonet (let's ignore the attack animations at the moment) and a gauss rifle that can only be used from a certain distance (say 4-8) both for ground attack (and the gauss rifle for air)
<<

Hercanic

User avatar

Site Admin

Posts: 399

Joined: June 6th, 2009, 12:25 am

Location: Arizona

Post June 25th, 2010, 12:37 am

Re: two of the same attacks?

File: Iscript.bin

Use IceCC or PyICE to edit.

Command: trgtrangecondjmp <distance> <labelname> - jumps to a block depending on the distance to the target. (read command as Target Range Conditional Jump)

16 distance = 1 weapon range. 256 max distance = 16 range.

Example from STF's Lancer

  Code:
DragoonGndAttkInit:
   playfram          0x00   # frame set 0
   wait              1
   playfram          0x11   # frame set 1
   wait              1
   playfram          0x22   # frame set 2
DragoonGndAttkRpt:
   trgtrangecondjmp   240 DragoonLocal05
   goto              DragoonLocal06

DragoonLocal05:
   wait              1
   nobrkcodestart    
   playsnd           80   # Bullet\hkmissle.wav
   attackwith        2
   playfram          0x33   # frame set 3
   wait              2
   playfram          0x22   # frame set 2
   wait              1
   nobrkcodeend      
   gotorepeatattk    
   ignorerest        

DragoonLocal06:
   wait              1
   nobrkcodestart    
   playsnd           70   # Bullet\tgofir00.wav
   playfram          0x33   # frame set 3
   wait              1
   attackwith        1
   playfram          0x22   # frame set 2
   wait              1
   nobrkcodeend      
   gotorepeatattk    
   ignorerest        

DragoonGndAttkToIdle:
   playfram          0x11   # frame set 1
   wait              1
   playfram          0x00   # frame set 0
   wait              1
   goto              DragoonWalkingToIdle
<<

TassadarZeratul

User avatar

Posts: 276

Joined: June 7th, 2009, 1:00 am

Location: Behind myself

Post July 7th, 2010, 5:27 am

Re: two of the same attacks?

randcondjmp can also be used if you want a randomized attack pattern. This is usually a bad idea in a standard RTS mod (as it can lead to victory/defeat being determined by random chance, or to micro becoming less useful), but could be useful in a non-RTS (or unconventional RTS, such as AO), for different animations with similar/identical damage output (such as the Mind Slayer in my SC2 project Wonk_Sauce, which uses Twin Shock Vortecies or Pentagram Blast at random), for unusual units (such as the Gamblegun in Wonk_Sauce, which fires three radically different weapons at random - it's role is to be equally useful against any type of ship), or for something like WC3's creeps (not to be confused with Creep - creeps are basically attacking critters).
Image

Return to How to? Can you?

Who is online

Users browsing this forum: No registered users and 1 guest

cron
phpBBST Software