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

Script Help Check if Statements

HOT
broken avatar :(
Created 10 years ago
by pashan
0 Members and 1 Guest are viewing this topic.
6,987 views
broken avatar :(
×
broken avatar :(
RadihaX
Location: caCanada
Date Registered: 2 September 2012
Last active: 3 years ago
Posts
978
Respect
Forum Rank
The Decider
Primary Group
Community Mapper Elite
My Groups
More
My Contact & Social Links
More
Signature
Overrun
Lockdown
Overrun (Black Ops Mod)
Snowglobe
Leviathan
Abandoned School
Ski Resort
Leviathan Redux
×
JBird632'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.
Community Mapper Elite Has shown excellence and experience in the area of custom mapping in the UGX-Mods community.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
JBird632's Contact & Social LinksJBird632JBird632JBird632JBird632JBird632Mapper
Code Snippet
Plaintext
 iprintln("what you want it to say");
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
use
Code Snippet
Plaintext
IPrintLn( "stuff?" );
or
Code Snippet
Plaintext
IPrintLnBold( "maybe?" );
broken avatar :(
×
broken avatar :(
UM Member, Mapper and 3d Modeler
Location: ca
Date Registered: 8 February 2014
Last active: 3 years ago
Posts
835
Respect
Forum Rank
The Decider
Primary Group
Community Mapper
My Groups
More
My Contact & Social Links
More
Personal Quote
Port Arthur
Signature
×
pashan's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
i am a beginer to scripting:

I get a bad synatx error in this script

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


ray_steps();
{

trigger_one = getent("s_one", "targetname");
trigger_one sethinstring(" Press and hold &&1 for Ray Gun ");
trigger_one setCursorHInt( "HINT_NOICON" );

trigger waittill("trigger", players");
flag_set("stop_wait");
iprintln("onjective 1");

trigger delete();
}
{

disable_trigger();

trigger_two = getent("s_two", "targetname");
trigger_two sethinstring(" Press and hold &&1 for Ray Gun ");
trigger_two setCursorHInt( "HINT_NOICON" );
flag_wait("stop_wait");
enable_trigger();

trigger waittill("trigger", players");
flag_set("stop_wait_two");
iprintln("onjective 2");

trigger delete();

}

this is also a test script for a step by step easter egg to get a ray gun at the end
Last Edit: March 31, 2014, 03:53:36 am by pashan
broken avatar :(
×
broken avatar :(
RadihaX
Location: caCanada
Date Registered: 2 September 2012
Last active: 3 years ago
Posts
978
Respect
Forum Rank
The Decider
Primary Group
Community Mapper Elite
My Groups
More
My Contact & Social Links
More
×
JBird632'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.
Community Mapper Elite Has shown excellence and experience in the area of custom mapping in the UGX-Mods community.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
JBird632's Contact & Social LinksJBird632JBird632JBird632JBird632JBird632Mapper
You ended the function and started a new new one with out a function name/function call?
Lines 18 and 19

Also when you said
Code Snippet
Plaintext
trigger delete();
it should be
Code Snippet
Plaintext
trigger_one delete();
(same with the second one)

When you tell the game to enable/disable a trigger you must put the trigger name that you want to enable/disable
example:
Code Snippet
Plaintext
trigger_one disable_trigger();
Last Edit: March 31, 2014, 04:00:39 am by JBird632
broken avatar :(
×
broken avatar :(
UM Member, Mapper and 3d Modeler
Location: ca
Date Registered: 8 February 2014
Last active: 3 years ago
Posts
835
Respect
Forum Rank
The Decider
Primary Group
Community Mapper
My Groups
More
My Contact & Social Links
More
Personal Quote
Port Arthur
×
pashan's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
You ended the function and started a new new one with out a function name/function call?
Lines 18 and 19

Also when you said
Code Snippet
Plaintext
trigger delete();
it should be
Code Snippet
Plaintext
trigger_one delete();
(same with the second one)

When you tell the game to enable/disable a trigger you must put the trigger name that you want to enable/disable
example:
Code Snippet
Plaintext
trigger_one disable_trigger();

i did what you told me but i still get the same error

bad syntax
ray_steps();

Updated:

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


ray_steps();
{

trigger_one = getent("s_one", "targetname");
trigger_one sethinstring(" Press and hold &&1 for Ray Gun ");
trigger_one setCursorHInt( "HINT_NOICON" );

trigger waittill("trigger", players");
flag_set("stop_wait");
iprintln("onjective 1");

trigger_one delete();
}

ray_steps_two();
{

disable_trigger_two();

trigger_two = getent("s_two", "targetname");
trigger_two sethinstring(" Press and hold &&1 for Ray Gun ");
trigger_two setCursorHInt( "HINT_NOICON" );
flag_wait("stop_wait");
enable_trigger();

trigger waittill("trigger", players");
flag_set("stop_wait_two");
iprintln("onjective 2");

trigger delete();

}
broken avatar :(
×
broken avatar :(
RadihaX
Location: caCanada
Date Registered: 2 September 2012
Last active: 3 years ago
Posts
978
Respect
Forum Rank
The Decider
Primary Group
Community Mapper Elite
My Groups
More
My Contact & Social Links
More
×
JBird632'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.
Community Mapper Elite Has shown excellence and experience in the area of custom mapping in the UGX-Mods community.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
JBird632's Contact & Social LinksJBird632JBird632JBird632JBird632JBird632Mapper
Didn't even notice that, you have a semicolon at the end of your function name
Code Snippet
Plaintext
ray_steps();
remove the semicolon
broken avatar :(
×
broken avatar :(
UM Member, Mapper and 3d Modeler
Location: ca
Date Registered: 8 February 2014
Last active: 3 years ago
Posts
835
Respect
Forum Rank
The Decider
Primary Group
Community Mapper
My Groups
More
My Contact & Social Links
More
Personal Quote
Port Arthur
×
pashan's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Didn't even notice that, you have a semicolon at the end of your function name
Code Snippet
Plaintext
ray_steps();
remove the semicolon

oh lol thanks for the help man

Post Merge: March 31, 2014, 04:19:25 am
it giving me another error now

bad syntax
trigger_two = getent("s_two", "targetname");

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


ray_steps()
{

trigger_one = getent("s_one", "targetname");
trigger_one sethinstring(" Press and hold &&1 for Ray Gun ");
trigger_one setCursorHInt( "HINT_NOICON" );

trigger_one waittill("trigger_one", players);
flag_set("stop_wait");
iprintln("onjective 1");

trigger_one delete();
}

ray_steps_two()
{

disable_trigger_two()

trigger_two = getent("s_two", "targetname");
trigger_two sethinstring(" Press and hold &&1 for Ray Gun ");
trigger_two setCursorHInt( "HINT_NOICON" );
flag_wait("stop_wait");
enable_trigger();

trigger_two waittill("trigger_two", players);
flag_set("stop_wait_two");
iprintln("onjective 2");

trigger_two delete();

}
Last Edit: March 31, 2014, 04:19:25 am by pashan
broken avatar :(
×
broken avatar :(
RadihaX
Location: caCanada
Date Registered: 2 September 2012
Last active: 3 years ago
Posts
978
Respect
Forum Rank
The Decider
Primary Group
Community Mapper Elite
My Groups
More
My Contact & Social Links
More
×
JBird632'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.
Community Mapper Elite Has shown excellence and experience in the area of custom mapping in the UGX-Mods community.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
JBird632's Contact & Social LinksJBird632JBird632JBird632JBird632JBird632Mapper
This was probably going to go back and forth for a while so I just edited the code:
Code Snippet
Plaintext
ray_steps()
{
trigger_one = getent("s_one", "targetname");
trigger_one sethinstring(" Press and hold &&1 for Ray Gun ");
trigger_one setCursorHInt( "HINT_NOICON" );
trigger_two = getent("s_two", "targetname");
trigger_two sethinstring(" Press and hold &&1 for Ray Gun ");
trigger_two setCursorHInt( "HINT_NOICON" );

trigger_two Hide();
trigger_two disable_trigger();
trigger_one waittill("trigger", player);
iprintln("onjective 1");
trigger_one delete();
trigger_two thread ray_steps_two();
}

ray_steps_two()
{
self Show();
self enable_trigger();

self waittill("trigger", player);
iprintln("onjective 2");

self delete();
}
Like I said before, I prefer not using flags, so I instead called the second function from the first.
broken avatar :(
×
broken avatar :(
UM Member, Mapper and 3d Modeler
Location: ca
Date Registered: 8 February 2014
Last active: 3 years ago
Posts
835
Respect
Forum Rank
The Decider
Primary Group
Community Mapper
My Groups
More
My Contact & Social Links
More
Personal Quote
Port Arthur
×
pashan's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
This was probably going to go back and forth for a while so I just edited the code:
Code Snippet
Plaintext
ray_steps()
{
trigger_one = getent("s_one", "targetname");
trigger_one sethinstring(" Press and hold &&1 for Ray Gun ");
trigger_one setCursorHInt( "HINT_NOICON" );
trigger_two = getent("s_two", "targetname");
trigger_two sethinstring(" Press and hold &&1 for Ray Gun ");
trigger_two setCursorHInt( "HINT_NOICON" );

trigger_two Hide();
trigger_two disable_trigger();
trigger_one waittill("trigger", player);
iprintln("onjective 1");
trigger_one delete();
trigger_two thread ray_steps_two();
}

ray_steps_two()
{
self Show();
self enable_trigger();

self waittill("trigger", player);
iprintln("onjective 2");

self delete();
}
Like I said before, I prefer not using flags, so I instead called the second function from the first.

get an error

unknow function
trigger_one sethinstring (" Press and hold &&1 for Ray Gun ");

broken avatar :(
×
broken avatar :(
RadihaX
Location: caCanada
Date Registered: 2 September 2012
Last active: 3 years ago
Posts
978
Respect
Forum Rank
The Decider
Primary Group
Community Mapper Elite
My Groups
More
My Contact & Social Links
More
×
JBird632'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.
Community Mapper Elite Has shown excellence and experience in the area of custom mapping in the UGX-Mods community.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
JBird632's Contact & Social LinksJBird632JBird632JBird632JBird632JBird632Mapper
add this stuff back to the top of the code:
Code Snippet
Plaintext
#include maps\_utility; 
#include common_scripts\utility;
#include maps\_zombiemode_utility;
Also how are you calling this code?
broken avatar :(
×
broken avatar :(
UM Member, Mapper and 3d Modeler
Location: ca
Date Registered: 8 February 2014
Last active: 3 years ago
Posts
835
Respect
Forum Rank
The Decider
Primary Group
Community Mapper
My Groups
More
My Contact & Social Links
More
Personal Quote
Port Arthur
×
pashan's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
add this stuff back to the top of the code:
Code Snippet
Plaintext
#include maps\_utility; 
#include common_scripts\utility;
#include maps\_zombiemode_utility;
Also how are you calling this code?

i have this at the top of the code.

and in nazi_zombie_mapname.gsc

under

Code Snippet
Plaintext
maps\_zombiemode::main();

i have

Code Snippet
Plaintext
thread maps\ray::ray_steps();

ray.gsc is the name of the gsc i have the script in
broken avatar :(
×
broken avatar :(
RadihaX
Location: caCanada
Date Registered: 2 September 2012
Last active: 3 years ago
Posts
978
Respect
Forum Rank
The Decider
Primary Group
Community Mapper Elite
My Groups
More
My Contact & Social Links
More
×
JBird632'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.
Community Mapper Elite Has shown excellence and experience in the area of custom mapping in the UGX-Mods community.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
JBird632's Contact & Social LinksJBird632JBird632JBird632JBird632JBird632Mapper
Oh it was missing a 't'
Code Snippet
Plaintext
ray_steps()
{
trigger_one = getent("s_one", "targetname");
trigger_one sethintstring(" Press and hold &&1 for Ray Gun ");
trigger_one setCursorHInt( "HINT_NOICON" );
trigger_two = getent("s_two", "targetname");
trigger_two sethintstring(" Press and hold &&1 for Ray Gun ");
trigger_two setCursorHInt( "HINT_NOICON" );

trigger_two Hide();
trigger_two disable_trigger();
trigger_one waittill("trigger", player);
iprintln("onjective 1");
trigger_one delete();
trigger_two thread ray_steps_two();
}

ray_steps_two()
{
self Show();
self enable_trigger();

self waittill("trigger", player);
iprintln("onjective 2");

self delete();
}
broken avatar :(
×
broken avatar :(
UM Member, Mapper and 3d Modeler
Location: ca
Date Registered: 8 February 2014
Last active: 3 years ago
Posts
835
Respect
Forum Rank
The Decider
Primary Group
Community Mapper
My Groups
More
My Contact & Social Links
More
Personal Quote
Port Arthur
×
pashan's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
sorry for bothering you but what if i wanted to add more triggers like 3 or 4 more
broken avatar :(
×
broken avatar :(
Location: se
Date Registered: 30 July 2013
Last active: 3 weeks ago
Posts
517
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
×
Ege115's Groups
Community 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
You make a new enity with the Getent stuff like this to lets say that we name it to trigger_three.
Code Snippet
Plaintext
trigger_three = getent("trigger_three", "targetname");
And then you have the different functions in your code you can choose from like,
Code Snippet
Plaintext
trigger_three hide();
And when you want the trigger to show,
Code Snippet
Plaintext
trigger_three show();
Last Edit: March 31, 2014, 05:01:00 am by Ege115
broken avatar :(
×
broken avatar :(
RadihaX
Location: caCanada
Date Registered: 2 September 2012
Last active: 3 years ago
Posts
978
Respect
Forum Rank
The Decider
Primary Group
Community Mapper Elite
My Groups
More
My Contact & Social Links
More
×
JBird632'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.
Community Mapper Elite Has shown excellence and experience in the area of custom mapping in the UGX-Mods community.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
JBird632's Contact & Social LinksJBird632JBird632JBird632JBird632JBird632Mapper
Code Snippet
Plaintext
ray_steps()
{
// Setting Up Triggers
trigger_one = getent("s_one", "targetname");
trigger_one sethintstring(" Press and hold &&1 for Ray Gun ");
trigger_one setCursorHInt( "HINT_NOICON" );
trigger_two = getent("s_two", "targetname");
trigger_two sethintstring(" Press and hold &&1 for Ray Gun ");
trigger_two setCursorHInt( "HINT_NOICON" );
trigger_three = getent("s_three", "targetname");
trigger_three sethintstring(" Press and hold &&1 for Ray Gun ");
trigger_three setCursorHInt( "HINT_NOICON" );
trigger_four = getent("s_four", "targetname");
trigger_four sethintstring(" Press and hold &&1 for Ray Gun ");
trigger_four setCursorHInt( "HINT_NOICON" );

// Hiding|Disabling Triggers
trigger_two Hide();
trigger_two disable_trigger();
trigger_three Hide();
trigger_three disable_trigger();
trigger_four Hide();
trigger_four disable_trigger();

// Trigger One
trigger_one waittill("trigger", player);
iprintln("onjective 1");
trigger_one delete();

// Enable Trigger Two
trigger_two Show();
trigger_two enable_trigger();

// Trigger Two
trigger_two waittill("trigger", player);
iprintln("onjective 2");
trigger_two delete();

// Enable Trigger Three
trigger_three Show();
trigger_three enable_trigger();

// Trigger Three
trigger_three waittill("trigger", player);
iprintln("onjective 2");
trigger_three delete();

// Enable Trigger Four
trigger_four Show();
trigger_four enable_trigger();

// Trigger Four
trigger_four waittill("trigger", player);
iprintln("onjective 2");
trigger_four delete();
}
I removed the second function, cause I didn't feel like making multiple functions which you would have to transfer the variables through

 
Loading ...