Basically I'm trying to alter the texture of an actor (Laser+LaserDot) that is being drawn on the canvas by a weapon with a simple command like SetLaserColour Blue Red for example. I currently have it working where you can alter the colour via a .ini file but that's not very practical...
heeeelp?
Changing actors' attribute through console command
8 posts •
Page 1 of 1
- Gizzy
- Skaarj Berserker
- Posts: 450
- Joined: 02 Feb 2010, 12:55
Subject: Changing actors' attribute through console command
Post Posted: 27 Oct 2012, 13:05
- diamond
- Skaarj Berserker
- Posts: 366
- Joined: 13 Nov 2007, 10:51
- Location: ROFLand
- Contact:
Subject: Re: Changing actors' attribute through console command
Post Posted: 27 Oct 2012, 17:47
editproperties?
this will bring the dialog with all object properties.
this will bring the dialog with all object properties.
UBerserker wrote:Architecture doesn't need to detailed, it just needs to be right.
- Gizzy
- Skaarj Berserker
- Posts: 450
- Joined: 02 Feb 2010, 12:55
Subject: Re: Changing actors' attribute through console command
Post Posted: 27 Oct 2012, 18:36
diamond wrote:editproperties?
this will bring the dialog with all object properties.
I mean during game..using a console command when that weapon is selected to change the colour of their laser for that gun from a predefined set of textures
- Bleeder91<NL>
- Skaarj Assassin
- Posts: 147
- Joined: 24 Jun 2011, 18:45
Subject: Re: Changing actors' attribute through console command
Post Posted: 27 Oct 2012, 19:58
Code: Select all
simulated exec function SetLaserColor(string NewColor)
{
Switch(caps(NewColor))
{
Case "BLUE":
Laser.Skin = Texture'Lasor.Color.Bluezor';
Break;
Case "GREEN":
Laser.Skin = Texture'Lasor.Color.Greenzor';
Break;
Case "RED":
Laser.Skin = Texture'Lasor.Color.Redzor';
Break;
}
}
Add that to the weapon and change it to the desired textjaz.
- bob
- Skaarj Lord
- Posts: 205
- Joined: 23 Apr 2011, 02:24
- Location: USA
- Contact:
Subject: Re: Changing actors' attribute through console command
Post Posted: 27 Oct 2012, 20:10
you could go one further and use dynamicloadobject to load any texture.
or have it cycle case when no string was specified
or even instead of string , use 3 args to specify color in RGB.
or have it cycle case when no string was specified
or even instead of string , use 3 args to specify color in RGB.
- Gizzy
- Skaarj Berserker
- Posts: 450
- Joined: 02 Feb 2010, 12:55
Subject: Re: Changing actors' attribute through console command
Post Posted: 27 Oct 2012, 20:49
Bleeder: thanks man, I'll look into it!
Bob: Not sure how to use dynamicloadobject :p as for the 3 args, how could I assign that colour to an actor to draw?
Bob: Not sure how to use dynamicloadobject :p as for the 3 args, how could I assign that colour to an actor to draw?
- Bleeder91<NL>
- Skaarj Assassin
- Posts: 147
- Joined: 24 Jun 2011, 18:45
Subject: Re: Changing actors' attribute through console command
Post Posted: 27 Oct 2012, 21:53
Downside of dynamicloadobject is that it floods with errors, duno if that's fixed in 227i.
In this case if you type SetLaserColor Green in-game, it will set the laser's skin to Texture'Lasor.Color.Greenzor'. You can replace that with whatever texture fits and add LaserDot below it too.. forgot that one. That does, however, mean the laser has to be a var and not a local. If it's local, you could try this:
And add the next line before the laser is drawn:
Laser.Skin = LaserColor;
In this case if you type SetLaserColor Green in-game, it will set the laser's skin to Texture'Lasor.Color.Greenzor'. You can replace that with whatever texture fits and add LaserDot below it too.. forgot that one. That does, however, mean the laser has to be a var and not a local. If it's local, you could try this:
Code: Select all
var travel texture LaserColor;
simulated exec function SetLaserColor(string NewColor)
{
//Default laser color;
LaserColor = Texture'Lasor.Color.Redzor';
Switch(caps(NewColor))
{
Case "BLUE":
LaserColor = Texture'Lasor.Color.Bluezor';
Break;
Case "GREEN":
LaserColor = Texture'Lasor.Color.Greenzor';
Break;
Case "RED":
LaserColor = Texture'Lasor.Color.Redzor';
Break;
}
}
And add the next line before the laser is drawn:
Laser.Skin = LaserColor;
- Gizzy
- Skaarj Berserker
- Posts: 450
- Joined: 02 Feb 2010, 12:55
Subject: Re: Changing actors' attribute through console command
Post Posted: 26 Nov 2012, 19:02
FIXED.
Mahoosive thanks Bob and Bleeder, I mashed together the case/switch statements with DynamicLoadObject and it works
Mahoosive thanks Bob and Bleeder, I mashed together the case/switch statements with DynamicLoadObject and it works
8 posts •
Page 1 of 1
Who is online
Users browsing this forum: No registered users and 19 guests