UGX-Mods

Call of Duty 5: World at War => Help Desk => Mapping => Topic started by: artsergo on January 15, 2017, 09:35:12 am

Title: Help me with FX (SP)
Post by: artsergo on January 15, 2017, 09:35:12 am
I have idea.  :)
I understand that in theory is quite possible to do, but how?
I want make in map.

When I run over a tunnel then I touch trigger_radius (or trigger_multiple) and it launches two effects:
- effect of shaking ground in (targetname = location1) on my map (with ability to setting force in time of shaking again),
- FX little fall dust from ceiling.

I understand that this trigger gives the command to start for  the effect of shaking and FX little fall dust from the ceiling when the trigger activited.

I have only one example script for running - shaking of the earth (with the ability to setting for force shaking of the earth and jerky repetition period between). And that is all.

But how all this is to tie together the trigger and all this shake and FX, that when one player touch this trigger all this to working?
But when a player get out from zone of this trigger then the effect of shaking of the earth and FX little fall dust from ceiling  - both is switched off.
But all this was repeat when one player reenters the action trigger zone.
how i understand this is working - trigger_multiple.


Script is shaking of the earth: 

Code Snippet
Plaintext
 main() {
        thread shake();

   //your other code
}

shake()
{
   for(;;){
           earthquake(0.2,5,(0,0,0),1400);  //0.4 - setting for force shaking (0.3 is default)
                                                               //5 - the duration of the shaking of the earth
                                                               //      (in seconds is 10)
                                                               //1400 - radius of the earthquake
           wait(RandomFloatRange(5,45)); //default 20,300

           wait(5);
          }
}


Help me for resolve this problem, all tie together, please.  :-\
(and yes, such an example i see even in CoD2, where you go in some of the maps in tunnel with allies and there it FX and Shake earth is working.

i don't remember that it the map, but in the map has captain Price, tanks and sand ground


Help me for resolve this problem, please.  ::)
Title: Re: Help me with FX (SP)
Post by: Harry Bo21 on January 15, 2017, 12:42:28 pm
Thread on trigger

Code Snippet
Plaintext
trigger_logic()
{
    Self waittill( "trigger", player );
    // what do do here
}
Title: Re: Help me with FX (SP)
Post by: artsergo on January 15, 2017, 12:48:47 pm
Harry Bo21, hi!

Thank!
But how this trigger_multiple using with shake ground and FX in the radius?
Title: Re: Help me with FX (SP)
Post by: Harry Bo21 on January 15, 2017, 12:49:46 pm
That code will trigger whenever you touch a trigger multiple
Title: Re: Help me with FX (SP)
Post by: artsergo on January 15, 2017, 12:59:04 pm
how may looking this code
if need that trigger launches two things:

- effect of shaking ground in (targetname = location1) on my map
  (with ability to setting force in time of shaking again),
- FX little fall dust from ceiling.

and if a player go out from trigger then shaking ground and FX little fall dust - both is switched off.

Title: Re: Help me with FX (SP)
Post by: Harry Bo21 on January 15, 2017, 01:00:11 pm
Add your code to what I posted?

And use

Playfx( fx, origin );
Title: Re: Help me with FX (SP)
Post by: artsergo on January 15, 2017, 01:05:19 pm
i understanding after this line:

Code Snippet
Plaintext
   Self waittill( "trigger", player ); 


write: 
Code Snippet
Plaintext
 Playfx( fx, origin ); 

but How can make with shake script?
if his loading then not is - switched off.

I need then both such effects is - switched off if you go out from trigger

i such understanding this code need
Code Snippet
Plaintext
if { ..... }

But what can it looking ))
Title: Re: Help me with FX (SP)
Post by: artsergo on January 17, 2017, 06:30:14 pm
Maybe anybody know?
Title: Re: Help me with FX (SP)
Post by: BluntStuffy on January 17, 2017, 07:20:38 pm
Try this, i tried to write it easy to understand. Think it should work, not tested though  ::)

-Use 1 trigger_multiple that covers the entire area where you want the effects to happen.
-Use one script_struct ( NOT script_origin ) for the center of the earthquake
-Use one or more script_struct's (!) for the locations of the FX

You can find the targetname KVP at the top of the script

The fx needs to be a one-shot ( not looping ) FX, or this code will not work propperly and the fx wont stop playing..

Code Snippet
Plaintext
init()
{
level._effect[ "DUST" ] = Loadfx( "..." );

trigger = getent( "tunnel_trig", "targetname" ); // get the correct trigger
earthquake_org = getstruct( "tunnel_quake", "targetname" ); // use a SCRIPT_STRUCT for the center of the earthquake
dust_org = getstructarray( "tunnel_dust", "targetname" ); // use one or more SCRIPT_STRUCT's for the fx origin(s)
level.tunnel_shake = false;

level thread tunnel_stuff(trigger);
level thread shake(earthquake_org);
level thread dust(dust_org);
}

tunnel_stuff(trigger)
{
while(1)
{
count = 0;
players = get_players();

for( i=0 ; i<players.size ; i++ )
{
if( players[i] istouching( trigger ) ) // count all players touching the trigger, if at least one is touching it activate the stuff
{
count++;
break;
}
}

if( count > 0 && level.tunnel_shake == false )
{
level.tunnel_shake = true;
}

else if( count == 0 && level.tunnel_shake == true )
{
level.tunnel_shake = false;
}

wait 0.5;
}
}

shake(earthquake_org)
{
while(1)
{
if( level.tunnel_shake == true )
{
earthquake(0.2,5,earthquake_org.origin,1400);
wait(RandomFloatRange(5,45));

wait(5);
}

wait 0.5;
}
}

dust(dust_org)
{
while(1)
{
if( level.tunnel_shake == true )
{
for( i=0 ; i<dust_org.size ; i++ )
{
playfx( level._effect["DUST"], dust_org[i].origin );
}
wait(5); // match the time of your fx here to loop it correctly
}
wait 0.1;

if( level.tunnel_shake == false )
wait 0.5;
}
}




Put this in _zombiemode around line 60-70

Code Snippet
Plaintext
	maps\GSC_FILENAME::init();
Title: Re: Help me with FX (SP)
Post by: artsergo on January 18, 2017, 01:35:36 pm
Wow! BluntStuffy thanks!  ::)

I should try this)

and if all ok, I write about how this working.  :)

Double Post Merge: January 18, 2017, 07:59:07 pm
BluntStuffy hi!  :)
 Thank you very very much!

 You very helping me!
 include this (source archive: full source):  http://www.mediafire.com/file/iea0e5pg17lgwuw/sp_shake_dst.rar (http://www.mediafire.com/file/iea0e5pg17lgwuw/sp_shake_dst.rar)
yes, this archive has some errors with FX godrays but right now, this is no important

Most importantly, Shake and dusts workable! this is cool!

thank you again!  :)
 
in general, it is a working example - driving an earthquake and the effects inherent for earthquake )

And yes, BluntStuffy, i don't used "_zombiemode" library , this is working without "_zombiemode")


Double Post Merge: January 18, 2017, 08:12:59 pm