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

[Tutorial] Dynamic Light

HOT
broken avatar :(
Created 8 years ago
by Deleted User
0 Members and 1 Guest are viewing this topic.
15,357 views
broken avatar :(
  • DeletedUser
  • Deleted Member
×
broken avatar :(
DeletedUser
This user is deleted :(
Dynamic Light Tutorial


*For the lazy people there is a link a the bottom for the prefab.

Radiant Part:

Step 1:

Right click in the 2d grid to add a rope.



Step 2:

Place the rope halfway through the ceiling.



Step 3:

Right click in the 2d grid again and add a info > null



Step 4:

Place the info_null under the rope.



Step 5:

Select the rope first and then the info_null and press “W” to connect them.

Step 6:

Add a script_model and choose the model “lights_tinhatlamp_on” *It can be any other model but I have chosen to use this one for the example.

Step 7:

Place the script model under the info_null



Step 8:

Select the info_null first and then the script_model and press “W” to connect them.

Step 9:

Give the script_model the following kvp:
Code Snippet
Plaintext
"script_noteworthy" "dyn_lamp"

Step 10:

Add a light and place it under the script_model.



Step 11:

Give the light the following kvps:
Code Snippet
Plaintext
"maxmove" "500"
"maxturn" "360"
"targetname" "dyn_light"
"exponent" "1"
"fov_inner" "40"
"fov_outer" "60"
"spawnflags" "22"
"def" "light_point_linear"
"radius" "400"
"_color" "1 1 1"
"intensity" "2"

*Change the spotlight specific settings to whatever you like. But make sure u don’t change the spawnflags.

Step 12:

Add a info_null and place it under/inside the light. Now select the light and then the info_null and press “W” to connect them.



And that’s it for the radiant part. Now we only need to add a simple script to make this all work.

Scripting Part:

Step 1:

Add the following line in your “nazi_zombie_mapname.gsc” and place in under DLC3_FX():
Code Snippet
Plaintext
level._effect["chair_light_fx"] = loadfx("env/light/fx_glow_hanginglamp");

Step 2:

Add the following line under maps\_zombiemode::main():
Code Snippet
Plaintext
thread dynamic_light();

Step 3:

Add the following code at the bottom:
Code Snippet
Plaintext
dynamic_light()
{
lamp = getent("dyn_lamp","script_noteworthy");
light = getent("dyn_light","targetname");

if(!isdefined(light))
return;

light linkto(lamp);

fx = spawn("script_model", lamp.origin);
fx.angles = (90,0,0);
fx setmodel("tag_origin");
fx linkto(lamp);
playfxontag(level._effect["chair_light_fx"],fx,"tag_origin");

while(1)
{
lamp physicslaunch ( lamp.origin, (randomintrange(-20,20),randomintrange(-20,20),randomintrange(-20,20)) );
wait(randomfloatrange(10,15));
}
}

Step 4:

Add the following line to your “mod.csv”:
Code Snippet
Plaintext
fx,fx,env/light/fx_glow_hanginglamp

And that's it!

Update:

If you want to have multiple lights, use this code instead:

Scripting Part Multiple Lights:

Step 1:

Add the following line in your “nazi_zombie_mapname.gsc” and place in under DLC3_FX():
Code Snippet
Plaintext
level._effect["chair_light_fx"] = loadfx("env/light/fx_glow_hanginglamp");

Step 2:

Add the following line under maps\_zombiemode::main():
Code Snippet
Plaintext
lamps = getentarray("dyn_lamp","script_noteworthy");
array_thread(lamps,::dynamic_light);

Step 3:

Add the following code at the bottom:
Code Snippet
Plaintext
dynamic_light()
{
light = get_array_of_closest(self.origin,getEntArray("dyn_light","targetname"))[0];

if(!isdefined(light))
return;

light linkto(self);

fx = spawn("script_model", self.origin);
fx.angles = (90,0,0);
fx setmodel("tag_origin");
fx linkto(self);
playfxontag(level._effect["chair_light_fx"],fx,"tag_origin");

while(1)
{
self physicslaunch ( self.origin, (randomintrange(-20,20),randomintrange(-20,20),randomintrange(-20,20)) );
wait(randomfloatrange(10,15));
}
}

Step 4:

Add the following line to your “mod.csv”:
Code Snippet
Plaintext
fx,fx,env/light/fx_glow_hanginglamp

And that's for multiple lights.

Prefab


~RDV
:o1
broken avatar :(
×
broken avatar :(
Location: esBilbao
Date Registered: 6 September 2012
Last active: 5 years ago
Posts
84
Respect
Forum Rank
Rotting Walker
Primary Group
Member
My Contact & Social Links
More
×
ElTitoPricus's Groups
ElTitoPricus's Contact & Social LinksElTitoPricusElTitoPricus
Damn Good Job
Even me can understand it
Last Edit: November 02, 2015, 11:09:13 am by ElTitoPricus
broken avatar :(
×
broken avatar :(
Location: scotlandScotland
Date Registered: 19 March 2014
Last active: 4 years ago
Posts
254
Respect
Forum Rank
Mr. Elemental
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
ALM] Developer
Signature
Bloodsport :- RELEASED -:
-WIP- Cabin Unique :- 75% -:

×
TheScotchGuy's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
TheScotchGuy's Contact & Social LinksTheScotchGuyy
thank you so fekin much dude, iv been waiting like a whole year to find out how this is done! Worked first try too, really clear tut, nice work bro and thanks again.!
Last Edit: November 02, 2015, 09:45:53 am by TheScotchGuy
broken avatar :(
×
broken avatar :(
Location: trİstanbul
Date Registered: 26 December 2014
Last active: 6 days ago
Posts
126
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Community Mapper Elite
My Groups
More
My Contact & Social Links
More
×
c.h.n's Groups
Community Mapper Elite Has shown excellence and experience in the area of custom mapping in the UGX-Mods community.
c.h.n's Contact & Social Linksc_h_ncihan_gurbuzRadiantCHNCihan#5042
Great tutorial.
broken avatar :(
×
broken avatar :(
Location: gb
Date Registered: 22 September 2014
Last active: 4 years ago
Posts
360
Respect
Forum Rank
Perk Hacker
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
Here to make epic maps
×
pcmodder's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
pcmodder's Contact & Social Linkspcmodderugxken5hir0
Thanks very much this is very helpful for many Modders.  One question is this 1 entity or 2 for the limits ?   Good work  :rainbow:
Last Edit: November 02, 2015, 01:12:35 pm by pcmodder
broken avatar :(
  • DeletedUser
  • Deleted Member
×
broken avatar :(
DeletedUser
This user is deleted :(
There is a extra space in the:
Code Snippet
Plaintext
fx, fx,env/light/fx_glow_hanginglamp

It should be like this:
Code Snippet
Plaintext
fx,fx,env/light/fx_glow_hanginglamp

Also i will make a update on having more then 1 light. Not sure what the limit is yet. But i'll find out.
broken avatar :(
×
broken avatar :(
JbirdHaX
Location: se
Date Registered: 12 March 2012
Last active: 11 months ago
Posts
1,043
Respect
Forum Rank
Zombie Colossus
Primary Group
Community Mapper Elite
My Groups
More
My Contact & Social Links
More
Personal Quote
(_̅(_̅м̅a̅я̅i̅j̅u̅a̅n̅a̅_̅0 ด้้้้้็็็็็้้้้้็็็็็้
Signature
▒█▀▄▀█ ░█▀▀█ ▒█▀▀█ ▒█▀▀█ ▒█▀▀▀ ▒█▀▀█  ▒█▀▀▀ ▒█░░ ▀█▀ ▀▀█▀▀ ▒█▀▀▀
▒█▒█▒█ ▒█▄▄█ ▒█▄▄█ ▒█▄▄█ ▒█▀▀▀ ▒█▄▄▀  ▒█▀▀▀ ▒█░░ ▒█░ ░▒█░░ ▒█▀▀▀
▒█░░▒█ ▒█░▒█ ▒█░░░ ▒█░░░ ▒█▄▄▄ ▒█░▒█  ▒█▄▄▄ ▒█▄▄ ▄█▄ ░▒█░░ ▒█▄▄▄
×
RadimaX's Groups
Community Mapper Elite Has shown excellence and experience in the area of custom mapping in the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
thank you so fekin much dude, iv been waiting like a whole year to find out how this is done!

Scotch put 50 of them in a room and throw a granade for a Zombie Disco
broken avatar :(
×
broken avatar :(
Location: hu
Date Registered: 20 July 2014
Last active: 2 months ago
Posts
89
Respect
Forum Rank
Rotting Walker
Primary Group
Member
×
Deer2014's Groups
Deer2014's Contact & Social Links
Hi guys,

Can I placed more dynamic light? I mean in other rooms, corridors etc. How?
I tried to copy (light, info_null, scipting_model) but lost the glow effect and rope dancing animation.
broken avatar :(
×
broken avatar :(
Location: nlNederland
Date Registered: 14 August 2013
Last active: 7 years ago
Posts
50
Respect
Forum Rank
Rotting Walker
Primary Group
Member
Personal Quote
Wassaaap
Signature
×
WhiteDevil's Groups
WhiteDevil's Contact & Social Links
Nice tutorial!
broken avatar :(
  • DeletedUser
  • Deleted Member
×
broken avatar :(
DeletedUser
This user is deleted :(
Hi guys,

Can I placed more dynamic light? I mean in other rooms, corridors etc. How?
I tried to copy (light, info_null, scipting_model) but lost the glow effect and rope dancing animation.

Ill update the op soon with script for multiple lights. So stay tuned!

Double Post Merge: December 26, 2015, 09:55:06 am
Updated OP!
broken avatar :(
×
broken avatar :(
Location: hu
Date Registered: 20 July 2014
Last active: 2 months ago
Posts
89
Respect
Forum Rank
Rotting Walker
Primary Group
Member
×
Deer2014's Groups
Deer2014's Contact & Social Links
Ill update the op soon with script for multiple lights. So stay tuned!

Double Post Merge: December 26, 2015, 09:55:06 am
Updated OP!

Thanks RDV. Perfect! It works for me.
Last Edit: December 26, 2015, 02:26:59 pm by Deer2014
broken avatar :(
×
broken avatar :(
Location: de
Date Registered: 18 October 2013
Last active: 2 weeks ago
Posts
652
Respect
Forum Rank
Zombie Enslaver
Primary Group
Donator ♥
My Groups
More
×
InFInIX's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Oil Rig Beta Access
Oil Rig Beta Access
InFInIX's Contact & Social Links
Nice tut will upload a vid to proof it works with multiple lights :P :D
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 24 February 2016
Last active: 5 years ago
Posts
18
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Contact & Social Links
More
×
madsniper124's Groups
madsniper124's Contact & Social LinksTheSkeletorSkeletorIsHe
When the ceiling light moves, there's two spots where the light is. There is the light that is still shining on the ground, and the light at where ever the ceiling light is pointing at. How do I fix this?
broken avatar :(
×
broken avatar :(
Location: gb
Date Registered: 17 April 2013
Last active: 6 years ago
Posts
4
Respect
Forum Rank
Fresh Corpse
Primary Group
Member
My Contact & Social Links
More
×
bigbengy's Groups
bigbengy's Contact & Social Linksbigbengy1979bigbengy1979
you, SIR are a god! aprefab for the lazy people. I'm sold! gonna d/l this right now thank's ;D ;D ;D
broken avatar :(
×
broken avatar :(
Location: pl
Date Registered: 15 September 2017
Last active: 7 years ago
Posts
1
Respect
Forum Rank
Fresh Corpse
Primary Group
Member
×
misiek6313's Groups
misiek6313's Contact & Social Links
Hi. I have question how make light source on model of any lamp or on light corona. When I make light in COD4 items are lighted but I can't see source of light ( in gtkRadiant it is name Corona of light but here I don't see this)

 
Loading ...