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

1 problem with my script

HOT
broken avatar :(
Created 10 years ago
by Deleted User
0 Members and 1 Guest are viewing this topic.
3,726 views
broken avatar :(
  • zombie madness
  • Deleted Member
×
broken avatar :(
zombie madness
This user is deleted :(
this is my script:

Code Snippet
Plaintext
#include common_scripts\utility; 
#include maps\_utility;
#include maps\_zombiemode_utility;

main()
{
string = "lol";
iprintln ("get the power turned on");
iprintln (string);

trig = getEnt ("use_power_switch","targetname");
trig setHintString ("press &&1 to turn on power");
trig setCursorHint ("HINT_NOICON");
trig UseTriggerRequireLookAt();

trig waittill ("trigger");
trig Delete();
iprintln ("congrats the power is now on");
iprintln ("nothing to see here");
}
but for some reason its messing with the zombie spawns the zombies wont spawn untill i turn on the power

any ideas?
Last Edit: March 23, 2014, 06:51:01 pm by zombie madness
Marked as best answer by Deleted User 10 years ago
broken avatar :(
×
broken avatar :(
drago
Location: mx
Date Registered: 5 July 2013
Last active: 4 years ago
Posts
941
Respect
Forum Rank
The Decider
Primary Group
Member
My Contact & Social Links
More
×
jjbradman's Groups
jjbradman's Contact & Social Linksjjbradmanjjbradmanjjbradman
first of all use codeboxed, second, do you want the trigger to display that text or just do a print? also do you want the trigger to turn on the power?

anyways it seemed that you tried to do this, try it out ;)

just add

Code Snippet
Plaintext
thread maps\_script::main();
after maps\zombiemode in your map.gsc

and put this code in a gsc calles "_script" inside your mod maps folder

Code Snippet
Plaintext
#include common_scripts\utility; 
#include maps\_utility;
#include maps\_zombiemode_utility;

main()
{
players = get_players();

   for( i=0; i<players.size; i++ )
  {
  wait 2;
  players[i] iprintln ("get the power turned on");
  players[i] iprintln ("lol");
  }
 
   flag_wait( "electricity_on" );
 
   for( i=0; i<players.size; i++ )
  {
  players[i] iprintln ("congrats the power is now on");
  wait 1;
  players[i] iprintln ("nothing to see here");
  }
}
Last Edit: March 23, 2014, 06:56:49 pm by jjbradman
broken avatar :(
  • zombie madness
  • Deleted Member
×
broken avatar :(
zombie madness
This user is deleted :(
first of all use codeboxed, second, do you want the trigger to display that text or just do a print? also do you want the trigger to turn on the power?
i want the trigger to turn on the power and display the text but zombies wont spawn untill the power is on
broken avatar :(
×
broken avatar :(
drago
Location: mx
Date Registered: 5 July 2013
Last active: 4 years ago
Posts
941
Respect
Forum Rank
The Decider
Primary Group
Member
My Contact & Social Links
More
×
jjbradman's Groups
jjbradman's Contact & Social Linksjjbradmanjjbradmanjjbradman
i want the trigger to turn on the power and display the text but zombies wont spawn untill the power is on
you can use the code i posted that will print on screen what you wanted when the power is turned on, if you want the power trigger to display the text only when the player is looking at the trigger you would need to edit dlc3.gsc or zombiemode, i dont remember which managed the power switch :L
broken avatar :(
  • zombie madness
  • Deleted Member
×
broken avatar :(
zombie madness
This user is deleted :(
it didnt work
broken avatar :(
×
broken avatar :(
drago
Location: mx
Date Registered: 5 July 2013
Last active: 4 years ago
Posts
941
Respect
Forum Rank
The Decider
Primary Group
Member
My Contact & Social Links
More
×
jjbradman's Groups
jjbradman's Contact & Social Linksjjbradmanjjbradmanjjbradman
it didnt work
id gave bad syntax or didnt printed anything?
broken avatar :(
×
broken avatar :(
Location: de
Date Registered: 6 August 2012
Last active: 4 years ago
Posts
277
Respect
Forum Rank
Mr. Elemental
Primary Group
Community Scripter Elite
My Groups
More
×
YaPh1l's Groups
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
YaPh1l's Contact & Social Links
zombies wont spawn untill the power is on
That is because you are calling your script like this:
Code Snippet
Plaintext
maps\_file::main();
while you should be calling it as a thread, as jjbradman said:
Code Snippet
Plaintext
thread maps\_file::main();
But also, this
Code Snippet
Plaintext
#include common_scripts\utility; 
#include maps\_utility;
#include maps\_zombiemode_utility;

main()
{
players = get_players();

   for( i=0; i<players.size; i++ )
  {
  wait 2;
  players[i] iprintln ("get the power turned on");
  players[i] iprintln ("lol");
  }
 
   flag_wait( "electricity_on" );
 
   for( i=0; i<players.size; i++ )
  {
  players[i] iprintln ("congrats the power is now on");
  wait 1;
  players[i] iprintln ("nothing to see here");
  }
}
Is not necessary and badly overcomplicates the whole script. iPrintLn() will print on the screen of all players by default (= if not called on a specific player). So the original script was perfectly fine in that regard.
Anyway, you might be best off just editing the power switch code in dlc3_code.gsc

- Phil.
broken avatar :(
  • zombie madness
  • Deleted Member
×
broken avatar :(
zombie madness
This user is deleted :(
id gave bad syntax or didnt printed anything?
no the printing of the text is fine works and everything but the zombies do not spawn untill the power is turned on the script is messing with the zombies spawn somehow

Post Merge: March 23, 2014, 07:27:13 pm
That is because you are calling your script like this:
Code Snippet
Plaintext
maps\_file::main();
while you should be calling it as a thread, as jjbradman said:
Code Snippet
Plaintext
thread maps\_file::main();
But also, thisIs not necessary and badly overcomplicates the whole script. iPrintLn() will print on the screen of all players by default (= if not called on a specific player). So the original script was perfectly fine in that regard.
Anyway, you might be best off just editing the power switch code in dlc3_code.gsc

- Phil.
everything is fine to do with the iprintln but the zombies is my only problem they will not spawn unless the power is on which is located in another room
Last Edit: March 23, 2014, 07:27:13 pm by zombie madness
broken avatar :(
×
broken avatar :(
Location: de
Date Registered: 6 August 2012
Last active: 4 years ago
Posts
277
Respect
Forum Rank
Mr. Elemental
Primary Group
Community Scripter Elite
My Groups
More
×
YaPh1l's Groups
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
YaPh1l's Contact & Social Links
Would you post your mapname.gsc code?

- Phil.
broken avatar :(
  • zombie madness
  • Deleted Member
×
broken avatar :(
zombie madness
This user is deleted :(
Would you post your mapname.gsc code?

- Phil.
yeah shure and wait a sec i mis read the other post you put
broken avatar :(
×
broken avatar :(
drago
Location: mx
Date Registered: 5 July 2013
Last active: 4 years ago
Posts
941
Respect
Forum Rank
The Decider
Primary Group
Member
My Contact & Social Links
More
×
jjbradman's Groups
jjbradman's Contact & Social Linksjjbradmanjjbradmanjjbradman
lol yaphil slapped me again with my fails  :-X haha
but then the real problem must be other script not this one
broken avatar :(
  • zombie madness
  • Deleted Member
×
broken avatar :(
zombie madness
This user is deleted :(
lol yaphil slapped me again with my fails  :-X haha
but then the real problem must be other script not this one
its fixed now i was putting in maps instead of thread lol not bad considering its my first ever script
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 8 years ago
Posts
2,790
Respect
Forum Rank
King of the Zombies
Primary Group
Community Daedra
My Groups
More
My Contact & Social Links
More
Signature
Let's keep this thread on topic from here on in. -DBZ

+1 to off-topic reply -DBZ

lmao. Too funny.

Goliath Script Placer: http://ugx-mods.com/forum/index.php/topic,11234.msg125257/topicseen.html#new

"...Christ, people. Learn C, instead of just stringing random characters
together until it compiles (with warnings)..."

-Linus Torvalds
×
daedra descent's Groups
Community Daedra
Community Daedra
daedra descent's Contact & Social LinksBlueSoviet
You can have more than one power system. Just make a basic trig, edit the prefab's KVP's, and notify the level for the perks and "electricity on".  Just make sure that you have the original DLC3 power switch hidden in your map somewhere.
broken avatar :(
  • zombie madness
  • Deleted Member
×
broken avatar :(
zombie madness
This user is deleted :(
You can have more than one power system. Just make a basic trig, edit the prefab's KVP's, and notify the level for the perks and "electricity on".  Just make sure that you have the original DLC3 power switch hidden in your map somewhere.
then i woud of had the problem of xmodel limit im not too far from it all ready and it seems i dont have a lot in my map but im pretty shure pathnodes are classed as xmodel well thats what it says in my map info
broken avatar :(
×
broken avatar :(
Location: de
Date Registered: 6 August 2012
Last active: 4 years ago
Posts
277
Respect
Forum Rank
Mr. Elemental
Primary Group
Community Scripter Elite
My Groups
More
×
YaPh1l's Groups
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
YaPh1l's Contact & Social Links
I'm pretty certain that pathnodes do not count as models.

- Phil.

 
Loading ...