How to Shoot Different Kinds of RPGs: Difference between revisions

From EDukeWiki
Jump to navigation Jump to search
No edit summary
Cleaned Up.
Line 1: Line 1:
When the command [[shoot]] is used for RPG it doesn't work correcly, because the actor RPG is hard-coded.
When the [[shoot]] primitive is used for the RPG, it doesn't work correcly, because the RPG is hard-coded.


If you already have used it, probably you have got problems, and you report or not it.
If you already have tried it in your code, you probably have gotten these errors and may have reported them to no avail.


Now, let's explain a little about the RPG specifics:


Now, let's explain a little about:
RPG shot by player RPG weapon:            sizeat 14 14, strength 140~
RPG shot by player Devastator weapon:      sizeat 7 7, strength 140/4~, no SMALLSMOKE trail, spawn small EXPLOSION2
RPG shot by Commander and any other actor: sizeat 30 30, strength 140/4~
RPG shot by Overlord:                      sizeat 42 42, strength 140~
RPG shot by Cycloid Emperor:              sizeat 24 24, strength 140~, no SMALLSMOKE trail


RPG shot by player RPG weapon:              sizeat 14 14, strength 140~
'''Notes:'''
RPG shot by player Devastator weapon:        sizeat 7 7, strength 140/4~, no SMALLSMOKE trail, spawn small EXPLOSION2
RPG shot by Commander and any other actor:  sizeat 30 30, strength 140/4~
RPG shot by Overlord:                        sizeat 42 42, strength 140~
RPG shot by Cycloid Emperor:                sizeat 24 24, strength 140~, no SMALLSMOKE trail
<b>Notes:</b>


[[strength]] in case become the projectile damage, original Duke projectiles aren't like the ones from [[defineprojectile]] command.
:In EVENT_GAME and EVENT_EGS, setting the [[strength]] of hard-coded projectiles will change their damage amount, not their own hitpoint amount.


Devastator strength is not set by actor DEVISTATORBLAST FREEZETHROWER_WEAPON_STRENGTH as you can see in GAME.CON, it is RPG_WEAPON_STRENGTH (defined in USER.CON) divided by 4.
:The Devastator's strength is not set by this block of code:


actor RPG RPG_WEAPON_STRENGTH enda
actor FREEZEBLAST FREEZETHROWER_WEAPON_STRENGTH enda
'''actor DEVISTATORBLAST FREEZETHROWER_WEAPON_STRENGTH enda'''
actor COOLEXPLOSION1 COOL_EXPLOSION_STRENGTH enda
actor TRIPBOMB TRIPBOMB_STRENGTH enda


So, what you need to do is:
:Instead, it is RPG_WEAPON_STRENGTH (defined in USER.CON) divided by 4. DEVISTATORBLAST's tilenum is the second frame of FREEZEBLAST's full tile set, so the purpose of this actor is unknown.


* If you want to one actor shoot the Commander rocket (it is not the RPG shot by player) just use default <b>shoot RPG</b>.
So, what you need to do to fire the different types of RPG is:


* If you want to one actor shoot the player RPG:
If you want your actor to shoot the Fat Commander's rocket (it is not the RPG shot by player), then just use the default '''shoot RPG'''. Howerever, if you want your actor to shoot the player's, Overlord's, and\or Cycloid Emperor's RPG(s), or the Devastator then put this code into your CONs:
 
gamevar GAMEFLAG 0 0
gamevar EGSFLAG 0 0
gamevar picnum 0 2
gamevar spriteid 0 2
gamevar x 0 2
  onevent EVENT_GAME
  onevent EVENT_GAME
   ifactor RPG
  getactor[THISACTOR].picnum GAMEFLAG
    ifspawnedby MYACTOR
  switch GAMEFLAG
      sizeat 14 14
   case RPG:
    ifspawnedby '''<the name of the actor to fire the Devastator>''' { sizeat 7 7 }
    ifspawnedby '''<the name of the actor to fire the player's RPG>''' { sizeat 14 14 }
    ifspawnedby '''<the name of the actor to fire the Overlord's RPG>''' { sizeat 42 42 }
    ifspawnedby '''<the name of the actor to fire the Cycloid Emperor's RPG>''' { sizeat 24 24 }
  break
  endswitch
  endevent
  endevent
   
   
  onevent EVENT_EGS
  onevent EVENT_EGS
   ifactor RPG
  getactor[THISACTOR].picnum EGSFLAG
    ifspawnedby MYACTOR
  switch EGSFLAG
    {
      addstrength RPG_WEAPON_STRENGTH
   case RPG:
      addstrength RPG_WEAPON_STRENGTH
    ifspawnedby '''<the name of the actor to fire the player's RPG>'''
      addstrength RPG_WEAPON_STRENGTH
      {
    }
        addstrength RPG_WEAPON_STRENGTH
        addstrength RPG_WEAPON_STRENGTH
        addstrength RPG_WEAPON_STRENGTH
      }
    ifspawnedby '''<the name of the actor to fire the Overlord's RPG>'''
      {
        addstrength RPG_WEAPON_STRENGTH
        addstrength RPG_WEAPON_STRENGTH
        addstrength RPG_WEAPON_STRENGTH
      }
    ifspawnedby '''<the name of the actor to fire the Cycloid Emperor's RPG>'''
      {
        addstrength RPG_WEAPON_STRENGTH
        addstrength RPG_WEAPON_STRENGTH
        addstrength RPG_WEAPON_STRENGTH
      }
  break
  case SMALLSMOKE:
    getactor[THISACTOR].owner spriteid
    getactor[spriteid].picnum picnum
    ifvare picnum RPG
      {
        getactor[spriteid].xrepeat x
        ifvare x 24 { killit }
      }
  break
  endswitch
  endevent
  endevent
Note: Addstrength used to opposite the default X/4. Change the [[sizeat]] if you want the Overlord like rocket - nothing can be done about Cycloid Emperor rocket, because you cannot kill the SMALLSMOKE trail with sizeat)


* If you want one some actor shoot Devastators:
'''Note:''' Addstrength is used to do the inverse of the default division of RPG_WEAPON_STRENGTH by 4.
onevent EVENT_GAME
 
  ifactor RPG
'''Note 2:''' If sizeat is set to 7 7, then the game will automatically kill the SMALLSMOKE trail and EXPLOSION2 will become small.
    ifspawnedby MYACTOR
      sizeat 7 7
endevent
Note: If sizeat is set to 7 7, the game automatically kill the SMALLSMOKE trail and EXPLOSION2 become small.

Revision as of 17:39, 14 March 2007

When the shoot primitive is used for the RPG, it doesn't work correcly, because the RPG is hard-coded.

If you already have tried it in your code, you probably have gotten these errors and may have reported them to no avail.

Now, let's explain a little about the RPG specifics:

RPG shot by player RPG weapon:             sizeat 14 14, strength 140~
RPG shot by player Devastator weapon:      sizeat 7 7, strength 140/4~, no SMALLSMOKE trail, spawn small EXPLOSION2
RPG shot by Commander and any other actor: sizeat 30 30, strength 140/4~
RPG shot by Overlord:                      sizeat 42 42, strength 140~
RPG shot by Cycloid Emperor:               sizeat 24 24, strength 140~, no SMALLSMOKE trail

Notes:

In EVENT_GAME and EVENT_EGS, setting the strength of hard-coded projectiles will change their damage amount, not their own hitpoint amount.
The Devastator's strength is not set by this block of code:
actor RPG RPG_WEAPON_STRENGTH enda
actor FREEZEBLAST FREEZETHROWER_WEAPON_STRENGTH enda
actor DEVISTATORBLAST FREEZETHROWER_WEAPON_STRENGTH enda
actor COOLEXPLOSION1 COOL_EXPLOSION_STRENGTH enda
actor TRIPBOMB TRIPBOMB_STRENGTH enda
Instead, it is RPG_WEAPON_STRENGTH (defined in USER.CON) divided by 4. DEVISTATORBLAST's tilenum is the second frame of FREEZEBLAST's full tile set, so the purpose of this actor is unknown.

So, what you need to do to fire the different types of RPG is:

If you want your actor to shoot the Fat Commander's rocket (it is not the RPG shot by player), then just use the default shoot RPG. Howerever, if you want your actor to shoot the player's, Overlord's, and\or Cycloid Emperor's RPG(s), or the Devastator then put this code into your CONs:

gamevar GAMEFLAG 0 0
gamevar EGSFLAG 0 0
gamevar picnum 0 2
gamevar spriteid 0 2
gamevar x 0 2

onevent EVENT_GAME
 getactor[THISACTOR].picnum GAMEFLAG
 switch GAMEFLAG

  case RPG:
   ifspawnedby <the name of the actor to fire the Devastator> { sizeat 7 7 }
   ifspawnedby <the name of the actor to fire the player's RPG> { sizeat 14 14 }
   ifspawnedby <the name of the actor to fire the Overlord's RPG> { sizeat 42 42 }
   ifspawnedby <the name of the actor to fire the Cycloid Emperor's RPG> { sizeat 24 24 }
  break

 endswitch
endevent

onevent EVENT_EGS
 getactor[THISACTOR].picnum EGSFLAG
 switch EGSFLAG

  case RPG:
   ifspawnedby <the name of the actor to fire the player's RPG>
     {
       addstrength RPG_WEAPON_STRENGTH
       addstrength RPG_WEAPON_STRENGTH
       addstrength RPG_WEAPON_STRENGTH
     }
   ifspawnedby <the name of the actor to fire the Overlord's RPG>
     {
       addstrength RPG_WEAPON_STRENGTH
       addstrength RPG_WEAPON_STRENGTH
       addstrength RPG_WEAPON_STRENGTH
     }
   ifspawnedby <the name of the actor to fire the Cycloid Emperor's RPG>
     {
       addstrength RPG_WEAPON_STRENGTH
       addstrength RPG_WEAPON_STRENGTH
       addstrength RPG_WEAPON_STRENGTH
     }
  break

  case SMALLSMOKE:
   getactor[THISACTOR].owner spriteid
   getactor[spriteid].picnum picnum
   ifvare picnum RPG
     {
       getactor[spriteid].xrepeat x
       ifvare x 24 { killit }
     }
  break

 endswitch
endevent

Note: Addstrength is used to do the inverse of the default division of RPG_WEAPON_STRENGTH by 4.

Note 2: If sizeat is set to 7 7, then the game will automatically kill the SMALLSMOKE trail and EXPLOSION2 will become small.