Call of duty bo3: LightningStrikeEffects: Difference between revisions

From COD Modding & Mapping Wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
'''To add Lightning strike sky effect (not the FXs but the brightness) + Audio'''
'''To add Lightning strike sky effect (not the FXs but the sky flashes) + Audio'''




Line 104: Line 104:
</pre>
</pre>


* Compile the map fully
* Compile the map fully, enjoy!
 
== Credits ==
 
* Tools to extract GSC/CSC from Zod: Scobalula + kokole and Nukem
* This tutorial: Zeroy

Latest revision as of 03:49, 29 June 2020

To add Lightning strike sky effect (not the FXs but the sky flashes) + Audio


In Radiant

  • In your Map WorldSpawn add a new KVP:
"vsky" "zm_factory_lightning_ukko"

In Script

  • In your map GSC, add the following in Main Function
clientfield::register("toplayer", "lightning_strike", VERSION_SHIP, 1, "counter");
callback::on_spawned( &on_player_spawned );
level.lightningstrike_delay = 12; // You can change this value to suit
  • Then add 2 functions like so:
function on_player_spawned()
{
	level endon("game_ended");
	self endon("death");
	self endon("disconnect");

	self thread lightning_strike_player();
}

function lightning_strike_player()
{
	self endon("disconnect");

	util::wait_network_frame();

	while(1)
	{
		if(isdefined(self) && isPlayer(self))
		{
			self notify("lightning_strike");
			self clientfield::increment_to_player("lightning_strike", 1);
		}
		wait(level.lightningstrike_delay);
	}
}
  • In your Map CSC add the following to the Main function:
clientfield::register("toplayer", "lightning_strike", VERSION_SHIP, 1, "counter", &lightning_strike, !CF_HOST_ONLY, !CF_CALLBACK_ZERO_ON_NEW_ENT);
  • Then add a new function:
function lightning_strike(localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump)
{
	SetUkkoScriptIndex(localClientNum, 1, 1);
	playsound(0, "amb_lightning_dist_low", (0, 0, 0));
	wait(0.02);
	SetUkkoScriptIndex(localClientNum, 3, 1);
	wait(0.15);
	SetUkkoScriptIndex(localClientNum, 1, 1);
	wait(0.1);
	SetUkkoScriptIndex(localClientNum, 4, 1);
	wait(0.1);
	SetUkkoScriptIndex(localClientNum, 3, 1);
	wait(0.25);
	SetUkkoScriptIndex(localClientNum, 1, 1);
	wait(0.15);
	SetUkkoScriptIndex(localClientNum, 3, 1);
	wait(0.15);
	SetUkkoScriptIndex(localClientNum, 1, 1);
}

Audio

  • Finally, for audio, you will need to get the following Audio Files and place in your BO3 Root
  • Add the following to your sound config file (located in your map folder under sound\zoneconfig and open the szc file )


  • Find this :
"Sources" : [
{
	"Type" : "ALIAS",
	"Name" : "user_aliases",
	"Filename" : "user_aliases.csv",
	"Specs" : [ ] 
},

- add this directly underneath

{
	"Type" : "ALIAS",
	"Name" : "zm_thunder",
	"Filename" : "zm_thunder.csv",
	"Specs" : [ ] 
},
  • Compile the map fully, enjoy!

Credits

  • Tools to extract GSC/CSC from Zod: Scobalula + kokole and Nukem
  • This tutorial: Zeroy