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

Make texture change and lights come on with power

HOT
broken avatar :(
Created 10 years ago
by Centric
0 Members and 1 Guest are viewing this topic.
3,648 views
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 2 April 2014
Last active: 2 years ago
Posts
481
Respect
Forum Rank
Perk Hacker
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
If it's not perfect, you'll never see it.
Signature
Learn by doing, not copy and pasting.

Enjoy my 2015 contest map, a simple map with bo1-bo2 features
http://ugx-mods.com/forum/index.php?topic=14968.msg149200#
×
Centric's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Centric's Contact & Social Linkscentricccentric_
For my Christmas map entry I want my chritmas trees lights to change from an off texture to an on texture. And I want the lights to kick in. How would I do this?


Edit: just noticed this should probably go in the scripting section
Last Edit: October 13, 2014, 02:10:18 am by Centric
This topic contains a post which is marked as the Best Answer. Click here to view it.
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 16 June 2013
Last active: 2 years ago
Posts
1,005
Respect
Forum Rank
Zombie Colossus
Primary Group
Community Mapper
My Groups
More
My Contact & Social Links
More
Signature
Hey if you had tons of fun on playing my maps please DONATE :)

play ESTATE now, and claim your mansion back from the undead!
×
jei9363's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
jei9363's Contact & Social Linksjei9363jei9363jayingardia
2 script brush models, in script hide the first and show the other

Code Snippet
Plaintext

flag_wait("electricity_on");
lights_off hide();
lights_on show();


multiple brushes would use

Code Snippet
Plaintext
arrayShow()
{
for(i=0;i<self.size;i++)
self[i] Show();
}

Code Snippet
Plaintext
arrayHide()
{
for(i=0;i<self.size;i++)
self[i] Hide();
}
Last Edit: October 13, 2014, 02:15:28 am by jei9363
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 2 April 2014
Last active: 2 years ago
Posts
481
Respect
Forum Rank
Perk Hacker
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
If it's not perfect, you'll never see it.
×
Centric's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Centric's Contact & Social Linkscentricccentric_
Lights_on and lights_off would be the Targetname right? And how would you do this for lights? Since they arnt brushes
Marked as best answer by Centric 10 years ago
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 16 June 2013
Last active: 2 years ago
Posts
1,005
Respect
Forum Rank
Zombie Colossus
Primary Group
Community Mapper
My Groups
More
My Contact & Social Links
More
×
jei9363's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
jei9363's Contact & Social Linksjei9363jei9363jayingardia
in mapname.gsc

Code Snippet
Plaintext
thread power_lighting();

Code Snippet
Plaintext
power_lighting()
{

lights_off = GetEntArray( "lights_off", "targetname" );
lights_on = GetEntArray( "lights_on", "targetname" );

for(i=0;i<lights_on.size;i++) //hide on lights
lights_on[i] hide();

flag_wait("electricity_on");

for(i=0;i<lights_off.size;i++) //hide off lights
lights_off[i] hide();

for(i=0;i<lights_on.size;i++) //show on lights
lights_on[i] show();
}

didnt test let me know, and yes. they are now
Last Edit: October 13, 2014, 02:39:16 am by jei9363
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
Nice idea. You should make them twinkle too, but not simultaneously though. Perhaps with randomfloatrange(.5,.9)?
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 2 April 2014
Last active: 2 years ago
Posts
481
Respect
Forum Rank
Perk Hacker
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
If it's not perfect, you'll never see it.
×
Centric's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Centric's Contact & Social Linkscentricccentric_
Nice idea. You should make them twinkle too, but not simultaneously though. Perhaps with randomfloatrange(.5,.9)?

So if it gets a certain number it shows lights_on? That shouldnt be hard. Famous last words
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
×
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
So if it gets a certain number it shows lights_on? That shouldnt be hard. Famous last words

Not quite. You would incorporate another function, with what jei9363 provided for you, with a while loop in it that would alternate the brushes on and off with a wait(randomfloatrange(.5,.9)); in between the ons and offs so that they wait slightly different times and don't flicker on and off at the same time/rate.

You would want to set up one of the brushes as the target of the other, then show one and hide the other, wait(randomfloatrange(.5,.9));, hide one and show the other, wait(randomfloatrange(.5,.9));, loop.
Last Edit: October 13, 2014, 07:55:17 pm by MakeCents
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 2 April 2014
Last active: 2 years ago
Posts
481
Respect
Forum Rank
Perk Hacker
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
If it's not perfect, you'll never see it.
×
Centric's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Centric's Contact & Social Linkscentricccentric_
didnt work, ingame error was just "assert fail" Heres what I found in the console.log  http://pastebin.com/9AdAySAM I put the entire script at the end of mapname.gsc, and the thread power_lighting after zombie mode main
Last Edit: October 13, 2014, 08:43:06 pm by Centric
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 16 June 2013
Last active: 2 years ago
Posts
1,005
Respect
Forum Rank
Zombie Colossus
Primary Group
Community Mapper
My Groups
More
My Contact & Social Links
More
×
jei9363's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
jei9363's Contact & Social Linksjei9363jei9363jayingardia
that doesnt sound like its me.. does commenting it out fix the error?
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
×
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
didnt work, ingame error was just "asset fail" Heres what I found in the console.log  http://pastebin.com/9AdAySAM I put the entire script at the end of mapname.gsc, and the thread power_lighting after zombie mode main

that doesnt sound like its me.. does commenting it out fix the error?

What he ^ said. None of that looks related to this. It should of said "assert fail", not "asset", but that could have just been a typo.

Once you get jei9363's stuff working I can help you with the flickering if you want.
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 2 April 2014
Last active: 2 years ago
Posts
481
Respect
Forum Rank
Perk Hacker
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
If it's not perfect, you'll never see it.
×
Centric's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Centric's Contact & Social Linkscentricccentric_
commented it out and error is gone. and yea it was assert fail
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 16 June 2013
Last active: 2 years ago
Posts
1,005
Respect
Forum Rank
Zombie Colossus
Primary Group
Community Mapper
My Groups
More
My Contact & Social Links
More
×
jei9363's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
jei9363's Contact & Social Linksjei9363jei9363jayingardia
are you "running map after compile"? like when you tick the box to auto-run? idk my function looks pretty solid  :P

Double Post Merge: October 13, 2014, 09:02:47 pm
I dont think this is what MakeCents is describing but it'll make all turn on and off when the power's on

Code Snippet
Plaintext
power_lighting()
{
lights_off = GetEntArray( "lights_off", "targetname" );
lights_on = GetEntArray( "lights_on", "targetname" );

for(i=0;i<lights_on.size;i++) //hide on lights
lights_on[i] hide();

flag_wait("electricity_on");

for(i=0;i<lights_off.size;i++) //hide off lights
lights_off[i] hide();

for(i=0;i<lights_on.size;i++) //show on lights
lights_on[i] show();

thread flicker_lights(lights_off,lights_on);
}

flicker_lights(lights_off,lights_on)
{

while(1)
{

turn_christmas_lights_on(lights_off,lights_on);
wait .5;
turn_christmas_lights_off(lights_off,lights_on);
wait .5;

}

}

turn_christmas_lights_on(lights_off,lights_on)
{
for(i=0;i<lights_off.size;i++) //hide off lights
lights_off[i] hide();

for(i=0;i<lights_on.size;i++) //show on lights
lights_on[i] show();
}

turn_christmas_lights_off(lights_off,lights_on)
{
for(i=0;i<lights_off.size;i++) //show off lights
lights_off[i] show();

for(i=0;i<lights_on.size;i++) //hide on lights
lights_on[i] hide();
}
Last Edit: October 13, 2014, 09:02:47 pm by jei9363
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 2 April 2014
Last active: 2 years ago
Posts
481
Respect
Forum Rank
Perk Hacker
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
If it's not perfect, you'll never see it.
×
Centric's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Centric's Contact & Social Linkscentricccentric_
I dont know anyone who does that lol. Im lauching it in developer 2 and scrript_developer 1 once in game. Im usig ugx mod if that helps
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 16 June 2013
Last active: 2 years ago
Posts
1,005
Respect
Forum Rank
Zombie Colossus
Primary Group
Community Mapper
My Groups
More
My Contact & Social Links
More
×
jei9363's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
jei9363's Contact & Social Linksjei9363jei9363jayingardia
is power_lighting() an already defined function? (ctrl f it)
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 2 April 2014
Last active: 2 years ago
Posts
481
Respect
Forum Rank
Perk Hacker
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
If it's not perfect, you'll never see it.
×
Centric's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Centric's Contact & Social Linkscentricccentric_
chagned the name now the map loads but nothing is hidden and nothing turns on with power. Im going to revise it real quick

 
Loading ...