Mappers' Corner Mappers and Modders

Go Back   Omnip)o(tentS Forums > SERVERS > Mappers' Corner
Reply
 
Thread Tools Display Modes
Old 11-19-2017, 02:41 PM   #1
Binger
.

 
Binger's Avatar
 
Join Date: Nov 2007
Posts: 2,388
Default Team dependent textures on BSP?
Reply With Quote


Team dependent textures on BSP? Is this possible? Can I have a BSP surface show a different texture/shader depending on which core is blue/red (or triggered by anything)?
__________________
Binger is offline  
Old 11-19-2017, 02:53 PM   #2
Lagzilla
Getting there...
 
Join Date: Jan 2011
Location: Chicago
Posts: 862
Default
Reply With Quote


There is support for lighting changes... but it does not work well. Never saw a texture one.

Not sure what you are doing, but could you use a team triggered mover? (which also is glitchy)

A
Lagzilla is offline  
Old 11-19-2017, 03:42 PM   #3
Miauz55555
I'm a cute Cat.
 
Miauz55555's Avatar
 
Join Date: Apr 2016
Posts: 175
Default
Reply With Quote


Don't know about BSPs. But with SM it will work.
__________________

DiscordServer; SteamGroup; WebSite
Miauz55555 is offline  
Old 11-19-2017, 05:24 PM   #4
Binger
.

 
Binger's Avatar
 
Join Date: Nov 2007
Posts: 2,388
Default
Reply With Quote


Thanks for the fast replies.

There are a lot of good team colored textures that shipped with the game. It would be cool to have different sides of the map use team colored textures then swap them when the sides change.

Lights and SMs would be cool too. I'll look around later to see if I can find any info on how to do that but if one of you guys have a link handy to UDN or something with that info it would be appreciated.
__________________
Binger is offline  
Old 11-19-2017, 11:44 PM   #5
Lagzilla
Getting there...
 
Join Date: Jan 2011
Location: Chicago
Posts: 862
Default
Reply With Quote


I have found that the team trigger for SM's and lights are unreliable... at best. If it could work that would be awesome, I wanted to do lighting in Tyrant with it.
A
Lagzilla is offline  
Old 11-20-2017, 01:57 PM   #6
Binger
.

 
Binger's Avatar
 
Join Date: Nov 2007
Posts: 2,388
Default
Reply With Quote


For materials there is MaterialSwitch and Wombo made xTeamMaterialSwitch but I don't understand exactly what they are for and how to use them like I want. I found them by accident trying to understand if a material instance would work for me.

https://wiki.beyondunreal.com/User:W...MaterialSwitch

I still can't figure out even where to begin with either lights or SMs. One of you guys want to point me in the right direction? How do you trigger a static mesh to change it's material? How do you trigger a light to change it's color? I don't think I'm using good search terms and I can't figure it out just by looking at things in the editor. I feel like I'm missing something obvious.
__________________
Binger is offline  
Old 11-24-2017, 02:23 PM   #7
Binger
.

 
Binger's Avatar
 
Join Date: Nov 2007
Posts: 2,388
Default
Reply With Quote


Okay so how about SMs. I would like to use this sci-fi panel from Orbital. Its stock texture is ugly but in this map it uses two team colored shaders. It's a CTF map so there is no changing sides. There is no non-colored version of the same shaders. I could edit them in Gimp but I would rather have them change shaders for each round. So any idea how to do that? I understand the basics of events and triggers but I have no idea how to tie those to a texture or shader. I also don't know how to tie a trigger to a round change or if that's even possible.

I can't figure out how to use that xTeamMaterialSwitch that Wormbo made. It's an actor that gets placed in that map and I don't understand how it effects anything.

__________________
Binger is offline  
Old 11-26-2017, 11:44 PM   #8
Lagzilla
Getting there...
 
Join Date: Jan 2011
Location: Chicago
Posts: 862
Default
Reply With Quote


Quote:
Originally Posted by Miauz55555 View Post
Don't know about BSPs. But with SM it will work.
Do you know a map that this is working in? I have futzed with it a lot and no luck.


I did get team colored lighting to work.

A
Lagzilla is offline  
Old 11-28-2017, 01:59 PM   #9
Binger
.

 
Binger's Avatar
 
Join Date: Nov 2007
Posts: 2,388
Default
Reply With Quote


Quote:
Originally Posted by Lagzilla View Post
Do you know a map that this is working in? I have futzed with it a lot and no luck.


I did get team colored lighting to work.

A
Lag, don't go through much trouble for me. I'm mostly just curious. It has come to mind in the past (mostly BSP) so I thought I would ask.

Miauz pointed out to me that Medievel has some team colored meshes. They are modded versions of the team banners. The roofs for the towers at the core base. I haven't checked it out very well. I just opened the map in the editor to confirm I could find them and browsed the properties for a minute.

How did you get lights to work?

Check out the MeteorCity map. It's pretty cool. It has an arena theme with audiences and advertisements and is fun in that way but a lot of the BSP is team colored and doesn't change. That's why I gave up on editing it. IIRC the author said something about playing really long rounds against bots so I guess it's possible he never got to a second round.

Masterbath is the same way. The colored walls don't change. I don't think anyone even notices but on MeteorCity I think it would stand out more.

There's also that Deathrow map that darksonny recently pointed out.

BSP would be at the top of the list for team materials but I don't see that happening.

That SM in my screenshot uses a UV2Texture. I don't know how that is different from a skin.
__________________
Binger is offline  
Old 11-29-2017, 12:18 AM   #10
Binger
.

 
Binger's Avatar
 
Join Date: Nov 2007
Posts: 2,388
Default
Reply With Quote


An update for the record.

I tried using the xTeammeshes from Medievel. I had hope when I was able to replace the rooftop mesh with the mesh from Orbital but it's not working like I want. What happens is it replaces the first material on the SM with the team colored shingles from the rooftop. In its properties it has fields for blue and red skins but they don't seem to do anything. I'm thinking the texture is in the script so I would have to decompile to see about changing it.

The team monitors Wormbo made work so that's cool. He did replace the neat texture on the monitor frame with something ugly but that can be changed in the properties.

I still haven't figured out the material switch thing but I have an experiment in mind that I need to try.
__________________
Binger is offline  
Old 11-29-2017, 11:54 AM   #11
Lagzilla
Getting there...
 
Join Date: Jan 2011
Location: Chicago
Posts: 862
Default
Reply With Quote


The material switch thing is odd. It actually mungs the texture if you look at it in the texture browser. I assume I am making a simple mistake, since the editor is not intuitive.

Andrew
Lagzilla is offline  
Old 11-29-2017, 02:11 PM   #12
Binger
.

 
Binger's Avatar
 
Join Date: Nov 2007
Posts: 2,388
Default
Reply With Quote


Quote:
Originally Posted by Lagzilla View Post
The material switch thing is odd. It actually mungs the texture if you look at it in the texture browser. I assume I am making a simple mistake, since the editor is not intuitive.

Andrew
I had to go to Urban Dictionary for that one.

Are you talking about creating a new material switch in the texture browser or something to do with Wormbo's xTeamMaterialSwitch? Any clear explanations of what you've tried would be helpful. I'm going to keep posting here in case someone comes along later and tries this (plus it helps me).

So it seems like it should be possible to make a material which can be triggered to change but I can't figure that out.

https://wiki.beyondunreal.com/UE2:Ma...witch_(UT2004)

That page is about MaterialSwitch. I'm assuming it's talking about a MaterialSwitch that is created through the texture browser. I can't imagine what else it would talking about but I created a basic one and I don't see any way to change anything. There's nothing in it's properties about this stuff...

"A trigger-advanced list of materials"

"Instance functions

Reset

function Reset ()
Overrides: Modifier.Reset
Resets to the first material in the Materials list. Also resets that first material and the FallbackMaterial. Note that other materials in the list will not be reset.
Trigger

function Trigger (Actor Other, Actor EventInstigator)
Overrides: Modifier.Trigger
Switches to the next material in the Materials list. If the end of the list is reached, the first material is switched to.
The new material and the FallbackMaterial are triggered as well."

I don't understand what an Instance Function is. The properties are there but how do I access this Instance function stuff, like the trigger? IDK.

If I create a MaterialSequence there is a field for TriggerAction that has Ignore, Reset, Pause, and Stop but that is what happens after a trigger and I don't know how to tie a trigger to a Material so that doesn't help.

That's what it comes down to. Not getting a brush or SM to change its material (I don't think that's possible) but getting a material to change one of it's levels based off of an event (ActivationEventName from core/node).

The UDN is very sparse on materials info and doesn't help...

https://docs.unrealengine.com/udk/Tw...lTutorial.html

Something I've been reminded about with trying to get this work is how much this game seems capable of doing and that so many things it can do don't seem to be in the game.

I also played around with XTeamMaterialSwitch for a while last night but I can't figure that out. It seems like its purpose is exactly what I'm looking for but I'm stumped.
__________________
Binger is offline  
Old 11-29-2017, 03:45 PM   #13
Lagzilla
Getting there...
 
Join Date: Jan 2011
Location: Chicago
Posts: 862
Default
Reply With Quote


Here is a link to functional team lighting. Tested on a dedicated server as well.

https://www.mediafire.com/file/fi7kz...m-Lighting.ut2

Also, the lighting can act weird. Several I copied were locked on and I had to delete and recopy them. Not sure why. But this map has 2 nodes, and team lighting around them that works.

Quick notes on how this works:
ONS Power Node Special triggers two scripted triggers, blue light and red light
One scripted trigger for each color. Power node triggers the light, an event the script is waiting on. When it gets it, it triggers all lights with the proper name. It then waits for the node destruction to occur. If it does it re triggers the lights to turn them off.
The lights are regular triggered lamps set to toggle.

Quirks:
Coronas don't work.
Shadows are goofed up, light passes through things it should not.



Andrew
Lagzilla is offline  
Old 11-29-2017, 04:28 PM   #14
Lagzilla
Getting there...
 
Join Date: Jan 2011
Location: Chicago
Posts: 862
Default
Reply With Quote


Quote:
Originally Posted by Binger View Post
I had to go to Urban Dictionary for that one.
It seems it is going through the material tree of a specific shader?

The thing I tried was Wormbo's, it has the most stuff that seemed like what you wanted.

The material switch you were messing with should work, if the texture supported it, so it seems. Though the one you are wanting to use I don't think it will as there are separate texture files for each color/shader so on... I may be misunderstanding this though as it's a bit outside my comfort zone/realm of knowledge.

A
Lagzilla is offline  
Old 11-29-2017, 05:43 PM   #15
Binger
.

 
Binger's Avatar
 
Join Date: Nov 2007
Posts: 2,388
Default
Reply With Quote


Quote:
Originally Posted by Lagzilla View Post
Here is a link to functional team lighting. Tested on a dedicated server as well.

...
Wow, that's cool. There are some bugs though. At least one of them wasn't resetting on round change after I destroyed the core. There was a time everything was out of sync so that it was red when not built then would turn off when I built the node. Also there were times when both lights were on so that the light was purple. I didn't do any troubleshooting on it.

Also when I was on red I wasn't getting the label or health bar for the node.

Quote:
Originally Posted by Lagzilla View Post
It seems it is going through the material tree of a specific shader?

The thing I tried was Wormbo's, it has the most stuff that seemed like what you wanted.

The material switch you were messing with should work, if the texture supported it, so it seems. Though the one you are wanting to use I don't think it will as there are separate texture files for each color/shader so on... I may be misunderstanding this though as it's a bit outside my comfort zone/realm of knowledge.

A
I got this to work on BSP using the simple color materials he included with XTeamMaterialSwitch. So cool. I was trying too hard and was overlooking the simple solution, which worked. I need to mess around with different materials other than the simple ones he included and also try it on SMs. I'm hopeful though. I'll let you know when I get it done and upload a test map.

The default MaterialSwitch seems to just hold other materials. You can assign the MaterialSwitch to a BSP surface. What I don't understand is how it's supposed to switch the materials without using Wormbo's actor but no biggy as long as it works with his XTeamMaterialSwitch.

More later on methods and results...
__________________
Binger is offline  
Old 11-29-2017, 09:01 PM   #16
Binger
.

 
Binger's Avatar
 
Join Date: Nov 2007
Posts: 2,388
Default
Reply With Quote


Running into a bug. The BSP surfaces are going black (actually not receiving any light I think) when I shoot an infantry weapon close to them. If it's a horizontal surface that I'm standing on it's usually black but will flicker when shooting. Sometimes it sticks, other times not. Grrr. If it's a wall it will only glitch if I'm standing right next to it. It's not looking good.

Basic Method: Add the xTeamMaterialSwitch near a node or core. This will create a new embedded MaterialSwitch. Assign that MaterialSwitch to a BSP surface just like you would with any material. If added near a node then it will use three separate materials; the two for teams and a third for if the node isn't built. Adding next to a core will only use the two materials since the core is always active. It will only use one material per round. It's more complicated then that, ofc, but that's the basics.

I got it to work for SMs also but having trouble there as well. I only tried on that mesh from Orbital and it has multiple material layers. I tried 3 different methods and the UV mapping is still screwed up. I will try on a mesh with just one material layer which I expect to work as the I think the trouble I'm having is not with the actor but with the way the mesh and material layers are set up.
__________________
Binger is offline  
Old 11-30-2017, 07:31 PM   #17
Lagzilla
Getting there...
 
Join Date: Jan 2011
Location: Chicago
Posts: 862
Default
Reply With Quote


The light thing is a bummer. The node does not destroy when the round ends so it stays on until toggled next round... and it goes down hill from there.

A
Lagzilla is offline  
Old 11-30-2017, 11:02 PM   #18
Binger
.

 
Binger's Avatar
 
Join Date: Nov 2007
Posts: 2,388
Default
Reply With Quote


Quote:
Originally Posted by Lagzilla View Post
The light thing is a bummer. The node does not destroy when the round ends so it stays on until toggled next round... and it goes down hill from there.

A
Maybe the reset could be tied to a core activation?

There might be some event tag that is sent out when a new round starts but I don't know what it would be.
__________________
Binger is offline  
Old 11-30-2017, 11:19 PM   #19
Lagzilla
Getting there...
 
Join Date: Jan 2011
Location: Chicago
Posts: 862
Default
Reply With Quote


Quote:
Originally Posted by Binger View Post
Maybe the reset could be tied to a core activation?

There might be some event tag that is sent out when a new round starts but I don't know what it would be.
Here is the trick...

As coded, trigger lights act these ways:
Trigger Toggle: Toggle on/off with trigger event
Trigger On: On forever once triggered
Trigger Off: Off forever once triggered
Trigger Control: On while the trigger is active off when not. IE stand in proximity to the trigger and its on. Walk away and its off
Trigger Pound: Seems like it does not do much.

So basically, the only way to make this work right would be to track the light state AND reset it only if active when the round starts. Anything other than that will result in some of the lighting somewhere behaving oddly.

Scenario:
Standalone Node, never built during the round for some reason. At round start they will turn on and are muxed if ever built in the next round.
Lagzilla is offline  
Old 12-01-2017, 01:32 AM   #20
Binger
.

 
Binger's Avatar
 
Join Date: Nov 2007
Posts: 2,388
Default
Reply With Quote


Bummer.

I didn't look at the properties for the TriggerLight before I posted that. I just now read the lighting stuff in UDN and I can't think of a way to make it happen other than adding script to the light and I have no idea how to add "track the light state AND reset it only if active when the round starts". Funny how they call the action of the trigger "InitialState". It's almost like they intended to do that but didn't.

Code:
//=============================================================================
// TriggerLight.
// A lightsource which can be triggered on or off.
//=============================================================================
class TriggerLight extends Light;

//-----------------------------------------------------------------------------
// Variables.

var() float ChangeTime;        // Time light takes to change from on to off.
var() bool  bInitiallyOn;      // Whether it's initially on.
var() bool  bDelayFullOn;      // Delay then go full-on.
var() float RemainOnTime;      // How long the TriggerPound effect lasts

var   float InitialBrightness; // Initial brightness.
var   float Alpha, Direction;
var   actor SavedTrigger;
var   float poundTime;

//-----------------------------------------------------------------------------
// Engine functions.

// Called at start of gameplay.
simulated function BeginPlay()
{
    // Remember initial light type and set new one.
    InitialBrightness = LightBrightness;
    if( bInitiallyOn )
    {
        Alpha     = 1.0;
        Direction = 1.0;
    }
    else
    {
        Alpha     = 0.0;
        Direction = -1.0;
    }
    SetDrawType(DT_None);
}

// Called whenever time passes.
function Tick( float DeltaTime )
{
    Alpha += Direction * DeltaTime / ChangeTime;
    if( Alpha > 1.0 )
    {
        Alpha = 1.0;
        Disable( 'Tick' );
        if( SavedTrigger != None )
            SavedTrigger.EndEvent();
    }
    else if( Alpha < 0.0 )
    {
        Alpha = 0.0;
        Disable( 'Tick' );
        if( SavedTrigger != None )
            SavedTrigger.EndEvent();
    }
    if( !bDelayFullOn )
        LightBrightness = Alpha * InitialBrightness;
    else if( (Direction>0 && Alpha!=1) || Alpha==0 )
        LightBrightness = 0;
    else
        LightBrightness = InitialBrightness;
}

//-----------------------------------------------------------------------------
// Public states.

// Trigger turns the light on.
state() TriggerTurnsOn
{
    function Trigger( actor Other, pawn EventInstigator )
    {
        if( SavedTrigger!=None )
            SavedTrigger.EndEvent();
        SavedTrigger = Other;
        SavedTrigger.BeginEvent();
        Direction = 1.0;
        Enable( 'Tick' );
    }
}

// Trigger turns the light off.
state() TriggerTurnsOff
{
    function Trigger( actor Other, pawn EventInstigator )
    {
        if( SavedTrigger!=None )
            SavedTrigger.EndEvent();
        SavedTrigger = Other;
        SavedTrigger.BeginEvent();
        Direction = -1.0;
        Enable( 'Tick' );
    }
}

// Trigger toggles the light.
state() TriggerToggle
{
    function Trigger( actor Other, pawn EventInstigator )
    {
        if( SavedTrigger!=None )
            SavedTrigger.EndEvent();
        SavedTrigger = Other;
        SavedTrigger.BeginEvent();
        Direction *= -1;
        Enable( 'Tick' );
    }
}

// Trigger controls the light.
state() TriggerControl
{
    function Trigger( actor Other, pawn EventInstigator )
    {
        if( SavedTrigger!=None )
            SavedTrigger.EndEvent();
        SavedTrigger = Other;
        SavedTrigger.BeginEvent();
        if( bInitiallyOn ) Direction = -1.0;
        else               Direction = 1.0;
        Enable( 'Tick' );
    }
    function UnTrigger( actor Other, pawn EventInstigator )
    {
        if( SavedTrigger!=None )
            SavedTrigger.EndEvent();
        SavedTrigger = Other;
        SavedTrigger.BeginEvent();
        if( bInitiallyOn ) Direction = 1.0;
        else               Direction = -1.0;
        Enable( 'Tick' );
    }
}

state() TriggerPound {

    function Timer () {
    
        if (poundTime >= RemainOnTime) {
        
            Disable ('Timer');
        }
        poundTime += ChangeTime;
        Direction *= -1;
        SetTimer (ChangeTime, false);
    }

    function Trigger( actor Other, pawn EventInstigator )
    {

        if( SavedTrigger!=None )
            SavedTrigger.EndEvent();
        SavedTrigger = Other;
        SavedTrigger.BeginEvent();
        Direction = 1;
        poundTime = ChangeTime;            // how much time will pass till reversal
        SetTimer (ChangeTime, false);        // wake up when it's time to reverse
        Enable   ('Timer');
        Enable   ('Tick');
    }
}

defaultproperties
{
     bStatic=False
     bHidden=False
     bDynamicLight=True
     RemoteRole=ROLE_SimulatedProxy
     bMovable=True
}
__________________
Binger is offline  
Reply


Go Back   Omnip)o(tentS Forums > SERVERS > Mappers' Corner

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 01:56 PM.