TriggerEffects()

VheliumVhelium Join Date: 2012-11-24 Member: 173049Members
edited November 2012 in Modding
Hi guys,

I searched through all script files but I didnt find where TriggerEffects() is defined and also not where the variables for it (like sounds or cinematics) are defined in code.
Can someone help me out?

As I'm posting this thread, maybe anyone has a idea why my own scripted building isnt displayed on the minimap ?

Greetings Vhelium

[EDIT] I overlooked the Actor class which called the TriggerEffects in the EffectManager. But I still didnt find the values and where the effectTable is initialized [/EDIT]

Comments

  • JimWestJimWest Join Date: 2010-01-03 Member: 69865Members, Reinforced - Silver
    Well the trigger effects only trigger effects from these files:
    <!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->Script.Load("lua/GeneralEffects.lua")
    Script.Load("lua/ClientEffects.lua")
    Script.Load("lua/PlayerEffects.lua")
    Script.Load("lua/DamageEffects.lua")

    Script.Load("lua/MarineStructureEffects.lua")
    Script.Load("lua/MarineWeaponEffects.lua")
    Script.Load("lua/AlienStructureEffects.lua")
    Script.Load("lua/AlienWeaponEffects.lua")<!--c2--></div><!--ec2-->

    what exactly do you want to start in game?
  • VheliumVhelium Join Date: 2012-11-24 Member: 173049Members
    I wanted to play a sound like the armory does when it heals a player at a specific location.
  • JimWestJimWest Join Date: 2010-01-03 Member: 69865Members, Reinforced - Silver
    Try:

    <!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->testSound = PrecacheAsset("sound/NS2.fev/marine/common/pickup_gun")
    origin = player:GetOrigin()
    Shared.PlayWorldSound(nil, testSound, nil, origin)<!--c2--></div><!--ec2-->
  • VheliumVhelium Join Date: 2012-11-24 Member: 173049Members
    edited November 2012
    Thanks for the code, it works.
    But they never handle it that way, they always use things like:

    <div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>self:TriggerEffects("armory_health", {effecthostcoords = Coords.GetTranslation(ent:GetOrigin())})</div>

    And I thought I will do it the same way.
    But if that is infeasible, I'll keep it how you proposed.
  • JimWestJimWest Join Date: 2010-01-03 Member: 69865Members, Reinforced - Silver
    Well they do it that way, but then you have to add it in a Effecs file like MarineStructureEffects in the exact way.

    self:TriggerEffects -> Looks in MarineStructureEffects.lua:318, theres definied:
    <!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->            {sound = "sound/NS2.fev/marine/common/health"},
                {cinematic = "cinematics/marine/spawn_item.cinematic"},<!--c2--></div><!--ec2-->

    this calls EffectManager.lua:205
    this calls then EffectManager.lua:312

    and so on and after like 1000 entry of code it calls a Shared Command like
    Shared.CreateEffect or Shared.PlaySound etc.
  • VheliumVhelium Join Date: 2012-11-24 Member: 173049Members
    <!--quoteo(post=2037875:date=Nov 30 2012, 07:43 AM:name=JimWest)--><div class='quotetop'>QUOTE (JimWest @ Nov 30 2012, 07:43 AM) <a href="index.php?act=findpost&pid=2037875"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Well they do it that way, but then you have to add it in a Effecs file like MarineStructureEffects in the exact way.

    self:TriggerEffects -> Looks in MarineStructureEffects.lua:318, theres definied:
    <!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->            {sound = "sound/NS2.fev/marine/common/health"},
                {cinematic = "cinematics/marine/spawn_item.cinematic"},<!--c2--></div><!--ec2--><!--QuoteEnd--></div><!--QuoteEEnd-->

    Just seen your fast reponse.
    Now its clear, I overlooked the Effects files.
    Thank you for your help!
Sign In or Register to comment.