UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

Trigger FX after turning on Power

broken avatar :(
Created 8 years ago
by ZigorPowered
0 Members and 1 Guest are viewing this topic.
1,983 views
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 16 October 2016
Last active: 7 years ago
Posts
3
Respect
Forum Rank
Fresh Corpse
Primary Group
Member
×
ZigorPowered's Groups
ZigorPowered's Contact & Social Links
I have been trying to spawn some fx after turning on the power, but I have no idea why it isnt working.
Code Snippet
Plaintext
#precache("fx", "zombie/fx_mainframe_tip_zmb");
#precache("fx", "zombie/fx_mainframe_linked_rings_zmb");
#precache("fx", "zombie/fx_mainframe_linked_arcs_zmb");
function main()
{
thread precahce_fx();
zm_usermap::main();

thread zm_buildables::config();

level._zombie_custom_add_weapons =&custom_add_weapons;

//Setup the levels Zombie Zone Volumes
level.zones = [];
level.zone_manager_init_func =&usermap_test_zone_init;
init_zones[0] = "start_zone";
level thread zm_zonemgr::manage_zones( init_zones );

level.pathdist_type = PATHDIST_ORIGINAL;

level._model["p_axe"] = "xmodel/p7_farm_tools_axe";
//Cash back-----------------------------------------------------
perk_triggers = GetEntArray("under_perk", "targetname");
level.cashback_amount = 100;

for(i = 0; i < perk_triggers.size; i++)
{
perk_triggers[i] thread cash_back();
}
//-----------------------------------------------------------

//Power-------------------------------------------------------
level.struct_rings = GetEntArray("fx_ring", "targetname");
level.struct_arcs = GetEntArray("fx_arc", "targetname");

thread init_power();
//-------------------------------------------------------------
}
function precahce_fx()
{
level._effect["arcs"] = "zombie/fx_mainframe_linked_arcs_zmb";
level._effect["rings"] = "zombie/fx_mainframe_linked_rings_zmb";
}
//-------------------------------------------------------------

//-------------------------------TRIGGER FX WITH POWER---------------
function init_power()
{
level flag::wait_till("power_on");

for(i = 0; i < level.struct_rings.size; i++)
{
ring_fx = Spawn("script_model", level.struct_rings[i].origin);
ring_fx SetModel("tag_origin");
PlayFXOnTag(level._effect["rings"], ring_fx, "tag_origin");
}
for(i = 0; i < level.struct_arcs.size; i++)
{
arc_fx = Spawn("script_model", (-552, -1267, -14);
arc_fx SetModel("tag_origin");
PlayFXOnTag(level._effect["arcs"], arc_fx, "tag_origin");
}

}

struct_arcs and struct_rings are script_structs placed in my map to be used as the spawn origin/location

Thanks in Advance
Marked as best answer by ZigorPowered 8 years ago
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 4 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
Signature
×
MakeCents's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
Amusing you can add a iprintlnbold("power is on"); after the flag wait and it prints, and add one in the loop for each struct and it prints the origins of these structs, then:

Do you have the fx in your zone file?
Have you tried using the string instead of the level var?
 
Code Snippet
Plaintext
PlayFXOnTag("zombie/fx_mainframe_linked_rings_zmb", ring_fx, "tag_origin");

Did you verify these fx work and show up in radiant?
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 16 October 2016
Last active: 7 years ago
Posts
3
Respect
Forum Rank
Fresh Corpse
Primary Group
Member
×
ZigorPowered's Groups
ZigorPowered's Contact & Social Links
Amusing you can add a iprintlnbold("power is on"); after the flag wait and it prints, and add one in the loop for each struct and it prints the origins of these structs, then:

Do you have the fx in your zone file?
Have you tried using the string instead of the level var?
 
Code Snippet
Plaintext
PlayFXOnTag("zombie/fx_mainframe_linked_rings_zmb", ring_fx, "tag_origin");

Did you verify these fx work and show up in radiant?

Before trying this script I placed the fx in the map and it worked fine in Radiant and the game. What do you mean by having the fx in the zone file?

Double Post Merge: November 01, 2016, 09:53:09 pm
Nevermind, I browsed some of the built in zone files and figured it out. I added this to the end of the zone file
 
Code Snippet
Plaintext
//FX 
fx, zombie/fx_mainframe_tip_zmb
fx, zombie/fx_mainframe_linked_rings_zmb
fx, zombie/fx_mainframe_linked_arcs_zmb

Thanks for pointing this out!
Last Edit: November 01, 2016, 09:53:09 pm by ZigorPowered

 
Loading ...