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

Vision Switch?

broken avatar :(
Created 10 years ago
by Undeadmetal
0 Members and 1 Guest are viewing this topic.
4,362 views
broken avatar :(
×
broken avatar :(
Location: usOregon
Date Registered: 20 August 2014
Last active: 1 year ago
Posts
308
Respect
Forum Rank
Perk Hacker
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
Coding Hobbyist, Application & Web Development
Signature
×
Undeadmetal's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Undeadmetal's Contact & Social LinksOnlyAGamer
So I was wondering if there was a way to make the players vision change when they step through a trigger or just into a different area, how I would do that?

Like from default to sepia and so on.
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: 14 September 2013
Last active: 6 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
Signature
×
MakeCents's Groups
Mapper Has released one or more maps to the UGX-Mods 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
You can change vision files easily, just like done in laststand or solo quick revive. What you will have to watch out for, and is simple to do, is checking when they are in this area, even when they are downed, or die, because when they spawn back or get up the vision file will be set back.

You can check if the player is in that area, either via zone, or use player istouching(ent) and add a script ent like a trigger or just a noncolliding brush model textured with fog or something. Then set the vision file for that player.
Last Edit: February 09, 2016, 07:56:33 pm by MakeCents
broken avatar :(
×
broken avatar :(
Location: usOregon
Date Registered: 20 August 2014
Last active: 1 year ago
Posts
308
Respect
Forum Rank
Perk Hacker
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
Coding Hobbyist, Application & Web Development
×
Undeadmetal's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Undeadmetal's Contact & Social LinksOnlyAGamer
You can change vision files easily, just like done in laststand or solo quick revive. What you will have to watch out for, and is simple to do, is checking when they are in this area, even when they are downed, or die, because when they spawn back or get up the vision file will be set back.

I'm really bad with scripting so I was wondering how I would Script A Change In Vision on walk through  ;D and implement it into my map!
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 6 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
×
MakeCents's Groups
Mapper Has released one or more maps to the UGX-Mods 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
I'm really bad with scripting so I was wondering how I would Script A Change In Vision on walk through  ;D and implement it into my map!

Well that's how you would do it. Sounds like you want someone to script it for you.  ;) I can do it later, if that is what you need. Or maybe someone will come across sooner. It's pretty simple, but requires some editing in laststand I think, or may be easily handled with notifies... maybe, in order to handle the revives and respawns. Or just a while loop and a player variable maybe... Many ways
Last Edit: February 09, 2016, 08:03:43 pm by MakeCents
broken avatar :(
×
broken avatar :(
Location: usOregon
Date Registered: 20 August 2014
Last active: 1 year ago
Posts
308
Respect
Forum Rank
Perk Hacker
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
Coding Hobbyist, Application & Web Development
×
Undeadmetal's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Undeadmetal's Contact & Social LinksOnlyAGamer
Well that's how you would do it. Sounds like you want someone to script it for you.  ;) I can do it later, if that is what you need. Or maybe someone will come across sooner. It's pretty simple, but requires some editing in laststand I think, or may be easily handled with notifies... maybe, in order to handle the revives and respawns

That would be great! I get confused with scripting  :'(

Credit Will Of Course Be Given.
Last Edit: February 09, 2016, 08:06:59 pm by Undeadmetal
Marked as best answer by Undeadmetal 10 years ago
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 6 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
×
MakeCents's Groups
Mapper Has released one or more maps to the UGX-Mods 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
That would be great! I get confused with scripting  :'(

Credit Will Of Course Be Given.

I haven't tested this, but sometimes I get lucky... You can put this in a text file, save it as something.gsc, and call it from zombiemode.gsc, maps\something::init(); under where all the others are called like _zombiemode_perks.

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

init(){
thread PlayerVisionSetup();
}
PlayerVisionSetup(){
flag_wait("all_players_connected");
players = get_players(  );
for( i=0;i<players.size;i++ ){
players[i] thread CheckPlayerVision();
players[i] thread WatchMe();
}
}
WatchMe(){
while(1){
self waittill_any( "death","spawn","fake_death" );
self.visioncheck = "zombie_factory";
wait(1);
}
}
CheckPlayerVision(){
self endon( "disconnect" );
newVision = "sophia";//This name would be the vision file name to set when in those areas
defaultVision = "zombie_factory";//i assume this is your default one, if not change it then
self.visioncheck = defaultVision;
transition_time = .5;
while(1){
if(is_player_valid( self )){
if(self IsTouchingAny( newVision ) && (!IsDefined( self.visioncheck ) || self.visioncheck != newVision)){
self SetMyVision(newVision,transition_time);
}else if(IsDefined( self.visioncheck ) && self.visioncheck != defaultVision){
self SetMyVision(defaultVision,transition_time);
}
}
wait(.5);
}
}
SetMyVision(vision,time){
self endon( "disconnect" );
self endon( "death" );
self endon( "fake_death" );
self endon( "spawn" );
self set_vision_set( vision,time );
self.visioncheck = vision;
}
IsTouchingAny(value){
self endon( "disconnect" );
self endon( "death" );
self endon( "fake_death" );
self endon( "spawn" );
ents = GetEntArray( value,"targetname" );
for( i=0;i<ents.size;i++ ){
if(self IsTouching( ents[i] )) return true;
}
return false;
}


You would put these ents or trigger multiples where you want the vision to change. The targetname kvp will be the same as the vision file you want to set. So if the vision file is sophia, then the targetname kvp will be sophia, or whatever it is called. Edit the lines as necessary. Sorry for syntax errors or it just not working.  :D

Would be great to hear from another with another idea. Or if this is incorporated anywhere in COD already?
Last Edit: February 09, 2016, 08:44:14 pm by MakeCents
broken avatar :(
×
broken avatar :(
Location: usOregon
Date Registered: 20 August 2014
Last active: 1 year ago
Posts
308
Respect
Forum Rank
Perk Hacker
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
Coding Hobbyist, Application & Web Development
×
Undeadmetal's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Undeadmetal's Contact & Social LinksOnlyAGamer
I'm going to test this out now, I'll tell you how it goes thanks a bunch!  :D
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 6 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
×
MakeCents's Groups
Mapper Has released one or more maps to the UGX-Mods 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
I'm going to test this out now, I'll tell you how it goes thanks a bunch!  :D

No prob, good luck. I made some tweaks, not sure if they made it before you saw it, here it is again to make sure:

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

init(){
thread PlayerVisionSetup();
}
PlayerVisionSetup(){
flag_wait("all_players_connected");
players = get_players(  );
for( i=0;i<players.size;i++ ){
players[i] thread CheckPlayerVision();
players[i] thread WatchMe();
}
}
WatchMe(){
while(1){
self waittill_any( "death","spawn","fake_death" );
self.visioncheck = "zombie_factory";
wait(1);
}
}
CheckPlayerVision(){
self endon( "disconnect" );
newVision = "sophia";//This name would be the vision file name to set when in those areas
defaultVision = "zombie_factory";//i assume this is your default one, if not change it then
self.visioncheck = defaultVision;
transition_time = .5;
while(1){
if(is_player_valid( self )){
if(self IsTouchingAny( newVision ) && (!IsDefined( self.visioncheck ) || self.visioncheck != newVision)){
self SetMyVision(newVision,transition_time);
}else if(IsDefined( self.visioncheck ) && self.visioncheck != defaultVision){
self SetMyVision(defaultVision,transition_time);
}
}
wait(.5);
}
}
SetMyVision(vision,time){
self endon( "disconnect" );
self endon( "death" );
self endon( "fake_death" );
self endon( "spawn" );
self set_vision_set( vision,time );
self.visioncheck = vision;
}
IsTouchingAny(value){
self endon( "disconnect" );
self endon( "death" );
self endon( "fake_death" );
self endon( "spawn" );
ents = GetEntArray( value,"targetname" );
for( i=0;i<ents.size;i++ ){
if(self IsTouching( ents[i] )) return true;
}
return false;
}

broken avatar :(
×
broken avatar :(
Location: usOregon
Date Registered: 20 August 2014
Last active: 1 year ago
Posts
308
Respect
Forum Rank
Perk Hacker
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
Coding Hobbyist, Application & Web Development
×
Undeadmetal's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Undeadmetal's Contact & Social LinksOnlyAGamer
It worked for the most part no errors but It's constantly flashing in the transition phase  :-\ Any Idea why? when i looked at it looked fine to me! I think I have an idea on how to fix it but if you know what's wrong just let me know. Many Thanks
Last Edit: February 09, 2016, 09:10:05 pm by Undeadmetal
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 6 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
×
MakeCents's Groups
Mapper Has released one or more maps to the UGX-Mods 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
It worked for the most part no errors but It's constantly flashing in the transition phase  :-\ Any Idea why? when i looked at it looked fine to me! I think I have an idea on how to fix it but if you know what's wrong just let me know. Many Thanks

Hmmm. I don't see it unless you didn't get the last fix. The != was added where I only had = in the first one and a couple other copy/paste typos... Let me know if you fix it or not.

If you don't we can add some prints and see what is true when it should not be or we think it shouldn't be...


Edit: If your using trigger multiples we can rewrite a bit and optimize this a little if you want then. Only running the one part when it is triggered... instead of a constant .5 loop... but shouldn't affect anything really.

Double Post Merge: February 09, 2016, 09:52:08 pm
I think I see it, duh, lol

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

init(){
thread PlayerVisionSetup();
}
PlayerVisionSetup(){
flag_wait("all_players_connected");
players = get_players(  );
for( i=0;i<players.size;i++ ){
players[i] thread CheckPlayerVision();
players[i] thread WatchMe();
}
}
WatchMe(){
while(1){
self waittill_any( "death","spawned","fake_death" );
self.visioncheck = "zombie_factory";
wait(1);
}
}
CheckPlayerVision(){
self endon( "disconnect" );
newVision = "sophia";//This name would be the vision file name to set when in those areas
defaultVision = "zombie_factory";//i assume this is your default one, if not change it then
self.visioncheck = defaultVision;
transition_time = .5;
while(1){
if(is_player_valid( self )){
if(self IsTouchingAny( newVision ) && (!IsDefined( self.visioncheck ) || self.visioncheck != newVision)){
self SetMyVision(newVision,transition_time);
}else if(!self IsTouchingAny( newVision ) &&  IsDefined( self.visioncheck ) && self.visioncheck != defaultVision){
self SetMyVision(defaultVision,transition_time);
}
}
wait(.5);
}
}
SetMyVision(vision,time){
self endon( "disconnect" );
self endon( "death" );
self endon( "fake_death" );
self endon( "spawned" );
self set_vision_set( vision,time );
self.visioncheck = vision;
}
IsTouchingAny(value){
self endon( "disconnect" );
self endon( "death" );
self endon( "fake_death" );
self endon( "spawned" );
ents = GetEntArray( value,"targetname" );
for( i=0;i<ents.size;i++ ){
if(self IsTouching( ents[i] )) return true;
}
return false;
}


I added this in the else if:
Code Snippet
Plaintext
!self IsTouchingAny( newVision ) &&  

or better:

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

init(){
thread PlayerVisionSetup();
}
PlayerVisionSetup(){
flag_wait("all_players_connected");
players = get_players(  );
for( i=0;i<players.size;i++ ){
players[i] thread CheckPlayerVision();
players[i] thread WatchMe();
}
}
WatchMe(){
while(1){
self waittill_any( "death","spawned","fake_death" );
self.visioncheck = "zombie_factory";
wait(1);
}
}
CheckPlayerVision(){
self endon( "disconnect" );
newVision = "sophia";//This name would be the vision file name to set when in those areas
defaultVision = "zombie_factory";//i assume this is your default one, if not change it then
self.visioncheck = defaultVision;
transition_time = .5;
while(1){
if(is_player_valid( self )){
if(self IsTouchingAny( newVision )){
if(!IsDefined( self.visioncheck ) || self.visioncheck != newVision){
self SetMyVision(newVision,transition_time);
}
}else if(IsDefined( self.visioncheck ) && self.visioncheck != defaultVision){
self SetMyVision(defaultVision,transition_time);
}
}
wait(.5);
}
}
SetMyVision(vision,time){
self endon( "disconnect" );
self endon( "death" );
self endon( "fake_death" );
self endon( "spawn" );
self set_vision_set( vision,time );
self.visioncheck = vision;
}
IsTouchingAny(value){
self endon( "disconnect" );
self endon( "death" );
self endon( "fake_death" );
self endon( "spawn" );
ents = GetEntArray( value,"targetname" );
for( i=0;i<ents.size;i++ ){
if(self IsTouching( ents[i] )) return true;
}
return false;
}

Last Edit: February 10, 2016, 02:08:39 pm by MakeCents
broken avatar :(
×
broken avatar :(
Location: usOregon
Date Registered: 20 August 2014
Last active: 1 year ago
Posts
308
Respect
Forum Rank
Perk Hacker
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
Coding Hobbyist, Application & Web Development
×
Undeadmetal's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Undeadmetal's Contact & Social LinksOnlyAGamer
All this time I was looking for it, it was that lol well thanks worked like a charm!  :rainbow:

 
Loading ...