Triggering a FX !! >< need help!!!

Have questions about CoD4 mapping that aren't covered in the tutorials section? Post here!

Moderator: Core Staff

Post Reply
User avatar
Daggerblade
CJ Wannabe
CJ Wannabe
Posts: 10
Joined: November 8th, 2009, 12:09 am

Triggering a FX !! >< need help!!!

Post by Daggerblade » November 8th, 2009, 2:45 am

Hello everyone, i've spent loads of time trying to fix this by myself...i've rewritten this peice of code like 100 times and i cannot figure it out >< sad face...If anyone can help me, i think i would keel over and foam at the mouth and then explode...in a good way though. Heres the code:

Code: Select all

main()
{
	maps\mp\_load::main();
	//maps\mp\mp_testzor_fx::main();

	level._effect["explosions"] = loadFX("explosions/dragon_spawn");
	//maps\mp\_fx::loopfx("explosions", (80, 80, 0), 3); this was tested, without the trigger_explosion function, and worked, although it obviously just looped the effect instead of playing it once like i am trying to do...i have tried the func OneShotFX() as well, didn't work
	
	ambientPlay("ambient_backlot_ext");
	
	game["allies"] = "sas";
	game["axis"] = "spetsnaz";
	game["allies_soldiertype"] = "desert";
	game["axis_soldiertype"] = "desert";
	
	setdvar( "r_specularcolorscale", "1" );
	
	setdvar("r_glowbloomintensity0",".25");
	setdvar("r_glowbloomintensity1",".25");
	setdvar("r_glowskybleedintensity0",".3");
	setdvar("compassmaxrange","1800");
thread trigger_explosion();
//thread vehicle();

trigger_explosion()
{

trigger = GetEnt("trigger_radius", "targetname");

while(1)//infinite loop =( sad face
{
trigger WaitTill("trigger", player);
if(player IsTouching(trigger) && player UseButtonPressed())
{
//fx = LoadFX("explosions/dragon_spawn");
//org1 = (80,80,0);       These are all products of failed attempts...there were others that got deleted, although the problem  might be somewhere else
//maps\mp\_fx::OneShotfx("explosions",(80,80,0), 3);	
//PlayFX("dragon_spawn");		
//maps\mp\_fx::loopfx("explosions", (80, 80, 0), 3);
PlayFX(dragon_spawn);
}
}
}
//return o; ?? lol don't think so !
}

This functions is just supposed to make it so that when a player is within radius of the trigger, and presses the UseButton, the Effect plays. Any help would be greatly appreciated!!!!!

User avatar
waywaaaard
Core Staff
Core Staff
Posts: 2214
Joined: February 6th, 2006, 3:18 pm
Location: Germany/Bayern

Re: Triggering a FX !! >< need help!!!

Post by waywaaaard » November 8th, 2009, 2:26 pm

not sure but try to precache the fx
THAT HANDS WERE NOT TRACED!
visit my blog: Link
Soviet wrote:Yeah, watch out, Peds will hit you with his +5 D-Battleaxe of homosexuality :roll:

User avatar
Daggerblade
CJ Wannabe
CJ Wannabe
Posts: 10
Joined: November 8th, 2009, 12:09 am

Re: Triggering a FX !! >< need help!!!

Post by Daggerblade » November 10th, 2009, 3:49 am

hehe well you see the thing is....lol...im not sure how to precache but...

Heres my mp_mapname_fx.gsc

Code: Select all

main()
{
level._effect["dragon_spawn"] = loadfx("explosions/dragon_spawn");
}
And in my createfx folder.... mp_mapname.fx

Code: Select all

main()
{
ent = maps\mp\_utility::createOneshotEffect ("dragon_spawn");
ent.v[ "origin" ] = ( 80.0, 80.0, 0.0);
ent.v[ "fxid" ] = "dragon_spawn";
}
also in my ZONE File, i do have: fx,explosions/dragon_spawn
along with a bunch of other stuff ect. ect.

dragon_spawn is a custom effect that i made with the Effects editor...and it is in the explosions folder

I will continue to work this out. and thanks for the comment, because even though im not positive that i have that taken care of..but i think in the process i fixed other errors...and well now it compiles :) So hopefully i will get it working soon! So yeah dude, thanks again for the suggestion, hopefully i did it right~!!

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest