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

teddy bear power switch

broken avatar :(
Created 12 years ago
by aster-99
0 Members and 1 Guest are viewing this topic.
5,049 views
broken avatar :(
×
broken avatar :(
Location: itPordenone
Date Registered: 19 January 2014
Last active: 6 years ago
Posts
64
Respect
Forum Rank
Rotting Walker
Primary Group
Member
Signature
is the quality of ours convictions to determine success
×
aster-99's Groups
aster-99's Contact & Social Links
hi guys, i want to make 3 hidden shootable teddy bears in my map for turning the power on, but searching in the net i couldn't find anything... someone have an idea?
This topic contains a post which is marked as the Best Answer. Click here to view it.
broken avatar :(
  • steviewonder87
  • Deleted Member
×
broken avatar :(
steviewonder87
This user is deleted :(
Use Bam's 3 teddy bear song EE script and just adapt it to make the power on instead of playing a song  :)
broken avatar :(
×
broken avatar :(
Location: itPordenone
Date Registered: 19 January 2014
Last active: 6 years ago
Posts
64
Respect
Forum Rank
Rotting Walker
Primary Group
Member
×
aster-99's Groups
aster-99's Contact & Social Links
i've tried to add it but i don't know how to set the power on in that way...
Last Edit: June 05, 2014, 01:01:13 pm by aster-99
broken avatar :(
  • steviewonder87
  • Deleted Member
×
broken avatar :(
steviewonder87
This user is deleted :(
flag_set("electricity_on");

I'm not scripter but surely that should work?
broken avatar :(
×
broken avatar :(
Location: usYork, SC
Date Registered: 15 March 2014
Last active: 7 years ago
Posts
214
Respect
Forum Rank
Mr. Elemental
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
WaW Scriptor
Signature
WaW Scriptor
×
PROxFTW's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
PROxFTW's Contact & Social LinksPROxFTWPROxFTWPROxFTWPROxFTW
flag_set("electricity_on");

I'm not scripter but surely that should work?
It would not be flag_set can't remember what it is though. flag_set sets a flag to either be use to wait for something or activate something I believe
Last Edit: June 05, 2014, 02:14:43 pm by PROxFTW
broken avatar :(
  • steviewonder87
  • Deleted Member
×
broken avatar :(
steviewonder87
This user is deleted :(
So this -

Code Snippet
Plaintext
flag_set("electricity_on");
level notify("Pack_A_Punch_on");
level notify("sleight_on");
level notify("revive_on");
level notify("juggernog_on");
level notify("doubletap_on");

Wouldn't work?
broken avatar :(
×
broken avatar :(
Former UGX Lead Asset Creator
Location: ca
Date Registered: 17 August 2012
Last active: 7 years ago
Posts
1,932
Respect
Forum Rank
Zombie Destroyer
Primary Group
UGX V.I.P.
My Groups
More
My Contact & Social Links
More
Personal Quote
Eh?
Signature

(Click to enter portfolio)
×
SajeOne's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
UGX V.I.P.
UGX V.I.P.
So this -

Code Snippet
Plaintext
flag_set("electricity_on");
level notify("Pack_A_Punch_on");
level notify("sleight_on");
level notify("revive_on");
level notify("juggernog_on");
level notify("doubletap_on");

Wouldn't work?
That does work correctly, only the power switch itself will still act like it hasn't been activated with the switch in the down right position and the trigger to activate the power still visible. To fix this some changes to the power_electric_switch() function in dlc3_code are needed.
broken avatar :(
  • steviewonder87
  • Deleted Member
×
broken avatar :(
steviewonder87
This user is deleted :(
But I'm guessing since he wants to shoot the 3 bears to turn on the power he doesn't actually need to use a power switch, so could he not just place the power switch prefab somewhere hidden in the map out of reach and sight and use the code I posted?
broken avatar :(
×
broken avatar :(
Former UGX Lead Asset Creator
Location: ca
Date Registered: 17 August 2012
Last active: 7 years ago
Posts
1,932
Respect
Forum Rank
Zombie Destroyer
Primary Group
UGX V.I.P.
My Groups
More
My Contact & Social Links
More
Personal Quote
Eh?
×
SajeOne's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
UGX V.I.P.
UGX V.I.P.
But I'm guessing since he wants to shoot the 3 bears to turn on the power he doesn't actually need to use a power switch, so could he not just place the power switch prefab somewhere hidden in the map out of reach and sight and use the code I posted?
Yes that would work, but treyarch already has a function for what you posted. You can just call "maps\dlc3_code::power_electric_switch_on()" to achieve the same result.
broken avatar :(
×
broken avatar :(
Location: itPordenone
Date Registered: 19 January 2014
Last active: 6 years ago
Posts
64
Respect
Forum Rank
Rotting Walker
Primary Group
Member
×
aster-99's Groups
aster-99's Contact & Social Links
only for an info, where i can find the original bam's teddy's EE? i've found only users codes
broken avatar :(
×
broken avatar :(
Location: usYork, SC
Date Registered: 15 March 2014
Last active: 7 years ago
Posts
214
Respect
Forum Rank
Mr. Elemental
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
WaW Scriptor
×
PROxFTW's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
PROxFTW's Contact & Social LinksPROxFTWPROxFTWPROxFTWPROxFTW
Sorry about that all Stevie,I don't use flags often and don't have my PC fixed yet. I have figured why that would be like that in case of any more confusion. Also aster I would recommend just using ZKs tutorial with the song but use teddy bear models then just use a different trigger if you want it shot or not. Then also instead of it playing the song take that part out then thread the code that sajeone put. If I can get my PC working and you need help I can write this up for you.
broken avatar :(
×
broken avatar :(
Location: itPordenone
Date Registered: 19 January 2014
Last active: 6 years ago
Posts
64
Respect
Forum Rank
Rotting Walker
Primary Group
Member
×
aster-99's Groups
aster-99's Contact & Social Links
that is not necessary. i'll try that tomorrow... i've a very terrible toothache     :'(

Post Merge: June 06, 2014, 01:09:21 pm
ok, i've tried to do this script but it doesn't works
i called that thread
Code Snippet
Plaintext
thread EE1();
and at the bottom of the file i wrote this:
Code Snippet
Plaintext
EE1()
{
teddy1_trigger = getEnt("teedy1_trigger", "targetname"); //the trigger that you will use to start the sound
teddy2_trigger = getEnt("teddy2_trigger", "targetname");
teddy3_trigger = getEnt("teddy3_trigger", "targetname");

teddy1_trigger setCursorHint("HINT_NOICON");
    teddy1_trigger UseTriggerRequireLookAt();
teddy2_trigger setCursorHint("HINT_NOICON");
    teddy2_trigger UseTriggerRequireLookAt();
teddy3_trigger setCursorHint("HINT_NOICON");
    teddy3_trigger UseTriggerRequireLookAt();

for(;;)
{
teddy1_trigger waittill("trigger");
teddy2_trigger waittill("trigger");
teddy3_trigger waittill("trigger");

teddy1_trigger disable_trigger();
teddy2_trigger disable_trigger();
teddy3_trigger disable_trigger();

flag_set("electricity_on");
level notify("Pack_A_Punch_on");
level notify("sleight_on");
level notify("revive_on");
level notify("juggernog_on");
level notify("doubletap_on");
level notify("staminup_on");
level notify("mule_kick_on");
level notify("phd_flopper_on");
level notify("cherry_on");
level notify("ugx_jukebox_on");

}
}
the teddy's models have targetname EE1 and the trigger teddy1/2/3_trigger. i add some level notify for other things in the map
Last Edit: June 06, 2014, 01:10:50 pm by aster-99
Marked as best answer by aster-99 12 years ago
broken avatar :(
×
broken avatar :(
Location: se
Date Registered: 30 July 2013
Last active: 2 years ago
Posts
517
Respect
Forum Rank
Zombie Enslaver
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
×
Ege115's Groups
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Ege115's Contact & Social LinksEge115
Try this.
Code Snippet
Plaintext
#include common_scripts\utility;
#include maps\_utility;
#include maps\_zombiemode_utility;

main()
{
level.teddys = 0;
teddy1_trigger = getEnt("teddy1_trigger", "targetname");
teddy2_trigger = getEnt("teddy2_trigger", "targetname");
teddy3_trigger = getEnt("teddy3_trigger", "targetname");

teddy1_trigger thread turn_on_power();
teddy2_trigger thread turn_on_power();
teddy3_trigger thread turn_on_power();
}

turn_on_power()
{
self setCursorHint("HINT_NOICON");
self sethintstring ("Press &&1 to Hit teddy");
self waittill("trigger");

iprintln("You have found a teddy!");
self delete();

level.teddys = level.teddys + 1;

if(level.teddys == 3)
{
flag_set("electricity_on");

level notify("Pack_A_Punch_on");
level notify("sleight_on");
level notify("revive_on");
level notify("juggernog_on");
level notify("doubletap_on");
level notify("staminup_on");
level notify("mule_kick_on");
level notify("phd_flopper_on");
level notify("cherry_on");
level notify("ugx_jukebox_on");
}
}
Note, this is not tested.

Edit: To make this perfect when turning on the power, you will have to edit the power script itself, but this works too.
Last Edit: June 06, 2014, 05:25:02 pm by Ege115
broken avatar :(
×
broken avatar :(
Location: itPordenone
Date Registered: 19 January 2014
Last active: 6 years ago
Posts
64
Respect
Forum Rank
Rotting Walker
Primary Group
Member
×
aster-99's Groups
aster-99's Contact & Social Links
great! i've thinked your script didn't work because at the beginning of the first round the electricity starts automaticlly, but if i put the electricity switch prefab under the map all works fine ;) !

 
Loading ...