Jump to content


Weapon OCL nugget

  • Please log in to reply
6 replies to this topic

#1 chrisbolling2

  • Members
  • 14 posts
  • Location:Far, far away

Posted 05 February 2008 - 05:36 PM

I know about the nugget, but can't seem to figure out how to get the nugget to fire properly with a projectile nugget. IE: I use an special arrow and kill a horde, then the weapon ocl spawns barrow wights, but they don't spawn from the projectile impact location, they spawn from the originating location. Has any one ever applied this before?

#2 cahik_


    Sage engine ruler

  • Project Team
  • 1,896 posts
  • Location:Czech Republic
  • Projects:Rhovanion Alliance
  •  T3A Team Chamber Member and Crazy animator

Posted 05 February 2008 - 07:19 PM

it is because the arrow itself is another object. try adding that oclnugget to the warhead thigy specified in the weapon code instead of the actual weapon

Posted Image

Posted Image
Posted Image

#3 chrisbolling2

  • Members
  • 14 posts
  • Location:Far, far away

Posted 05 February 2008 - 08:26 PM

it is because the arrow itself is another object. try adding that oclnugget to the warhead thigy specified in the weapon code instead of the actual weapon

My apologies, I should have said that it was in the coding for the warhead. The damage is done at the impact location, but the OCL still originates from the firing location. For now I'm trying to see if I can use the effects from the Morgul Blade to get the effect I want and am getting mixed results. They die and spawn Barrow Wights, but they aren't acting quite right and die way to soon in relation to the timer for them.

#4 Sûlherokhh


    Sagacious Engineer

  • Project Team
  • 3,754 posts
  • Location:Central Germany
  • Projects:S.E.E., Sage A.I., Code Advisor
  •  'Axe'er of the Gordic Knot

Posted 05 February 2008 - 09:26 PM

Don't use the WeaponOCL. Check out the name of the projectile (not the warhead, which should be one line above or below inside the shooting weapon).
Once you have got the projectile name, look for it in the file 'subobjects.ini'. There are two, one is in the good object folder, one is in the evil object folder. Once you have found it, add a ''CreateObjectDie' or something that defines what OCL is triggered once the projectile object 'dies'. There are one or two examples in the subobjects.ini file, but you could look in 'neutralunits.ini' inside the first object (the balrog) for more code.
If you place the OCL in the projetile, the stuff appears where it hits.

You can also look here for a more indepth explanation by me: Bodies and Arrows

Edited by Sûlherokhh, 05 February 2008 - 10:08 PM.

Axed Head and A.I. Coder for S.E.E. and ... stuff

".. coding is basically boring. What's fun is finding out how things work, take them apart and then put them together in ways that were not intended nor even conceived."

#5 chrisbolling2

  • Members
  • 14 posts
  • Location:Far, far away

Posted 07 February 2008 - 09:02 AM

I went a different route altogether and got the desired effect I wanted by changing the type of damage in the damage nugget to that similar to the Morgul Blade. Will definitely be checking into what you have discussed though, it looked quite interesting. Thanks.

#6 Ridder Geel

Ridder Geel

    Master Yelloh

  • T3A Staff
  • 10,837 posts
  • Location:The Netherlands (AKA: Holland)
  • Projects:RC Mod + SEE + RTS Engine
  •  The Dangerous T3A Team Chamber Member
  • Division:BFME
  • Job:T3A Staff

Posted 10 February 2008 - 02:13 AM

Look at my tutorial:
on Page #6
I hope this helps you! :p

Edited by Ridder Geel, 11 February 2008 - 08:24 PM.

Ridder Geel

#7 Symonius

  • Members
  • 25 posts
  • Location:The ancient shield
  • Projects:TROW Mod
  •  Just a winged modder

Posted 10 August 2016 - 03:29 PM

If someone is still interested in how to spawn an object with a warhead, this is what I did to throw an isengard explosive mine:

First the weapon.ini, a simple weapon with a warhead and the projectile template with the model of a mine:
Weapon UrgannThrowExplosiveMine         ; BALANCE CaveTroll Weapon Rock
    ;IdleAfterFiringDelay        = 2000                            ; Do NOT idle after throwing or Bombard will break
    HoldDuringReload            = Yes
    AttackRange                    = MORDOR_TROLL_ROCK_RANGE
    WeaponSpeed                    = 200.0                            ; dist/sec (huge value == effectively instant)
    FireFX                        = FX_EntThrowSmallRock
    PreAttackDelay                = 1400
    FiringDuration                = 2000
    PreAttackType                = PER_SHOT                        ; Do the delay each time we attack a new target
    DelayBetweenShots            = 6100
    HitPercentage                = 0                                ; never auto hits, always hits ground
    ScatterRadius                = 4.0                            ; When this weapon misses it can randomly miss by as much as this distance.
    IsAimingWeapon                = Yes                            ; Shooter will use his AimWeaponBehavior to get extra model condition flags
    NoVictimNeeded                = Yes                            ; Need no target
    LeechRangeWeapon            = Yes

    AutoReloadWhenIdle            = 1500                            ; should be a bit less than IdleAfterFiringDelay
    ClipSize                     = 1
    AutoReloadsClip             = Yes
    ClipReloadTime                 = 2100

    ProjectileNugget                                ; A Nugget that creates an Object and sends it to the target with a Warhead
        ProjectileTemplateName    = ThrowableExplosiveMine ;IsengardExplosiveMine ;RockBigTroll
        WarheadTemplateName        = UrgannExplosiveMineThrowWarhead

Weapon UrgannExplosiveMineThrowWarhead
    ProjectileCollidesWith = ENEMIES NEUTRAL STRUCTURES WALLS            ; Remember, the projectile is a rock, who has no allies
;        FireFX = FX_RockDetonation
        DamageNugget                                                            ; A basic Nugget that just does damage
        Damage            = MORDOR_CAVE_TROLL_ROCK_DAMAGE
        Radius            = 12.0
        DamageType        = SIEGE
        DamageFXType    = SMALL_ROCK
        DeathType        = NORMAL
    MetaImpactNugget                                                            ; A Nugget that throws things back with force
;        HeroResist            = .75
        ShockWaveAmount        = 50.0
        ShockWaveRadius        = 12.0
        ShockWaveTaperOff    = 0.5
        ShockWaveZMult        = 1.20



This is the projectile template, the object inherit the treebeard rock but it isn't important


ChildObject ThrowableExplosiveMine RockBigTreeberd
    Draw = W3DScriptedModelDraw ModuleTag_01
            Model = IU_BOMB_SKN


Here i used a behaviour that spawn an ocl when the unit die...in this case when the warhead hit the ground or the target


    Behavior = CreateObjectDie ModuleTag_CrushUnitsOnDeath
        CreationList = OCL_SpawnExplosiveMine


I hope this could help someone

Edited by Symonius, 10 August 2016 - 03:30 PM.

"All we have to decide is what to mod with the time that is given us"

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users