That's because you only need to edit the default properties.
Just right click on the new class you made and select default properties, then edit the stuff to how you want it to be.
UScript: Chat, Questions, Discussion
- SteadZ
- Skaarj Warlord
- Posts: 883
- Joined: 04 Mar 2012, 10:52
- Location: An error occurred. Please try again later.
- Contact:
- makemeunreal
- Banned
- Posts: 1294
- Joined: 20 Mar 2011, 09:20
- Contact:
Subject: Re: UScript: Chat, Questions, Discussion
Post Posted: 08 Jun 2013, 18:31
Ohmm...THANKS! It will be good.
"They let us go about our business here, but it is a farce. I know that they are watching us, controlling us. I believe that this once safe haven is as deadly as the surface planet below."
- xRedStar
- Skaarj Assassin
- Posts: 122
- Joined: 13 Jan 2013, 18:56
Subject: Re: UScript: Chat, Questions, Discussion
Post Posted: 19 Jul 2013, 20:06
Is it possible to assign a new target, based on range and\or proximity to the crosshair? Or is the targeting system all engine based?
- makemeunreal
- Banned
- Posts: 1294
- Joined: 20 Mar 2011, 09:20
- Contact:
Subject: Re: UScript: Chat, Questions, Discussion
Post Posted: 20 Jul 2013, 09:59
If somebody have the ugold/UT script source files, please send them to me via pm.
Thanks in advance.
Thanks in advance.
"They let us go about our business here, but it is a farce. I know that they are watching us, controlling us. I believe that this once safe haven is as deadly as the surface planet below."
- Buff Skeleton
- >:E
- Posts: 4173
- Joined: 15 Dec 2007, 00:46
Subject: Re: UScript: Chat, Questions, Discussion
Post Posted: 20 Jul 2013, 16:52
You can export them yourself from WOTGreal's Advanced Exporter or UED, or just reference them on the Unreal Wiki or any other site that hosts all the source scripts.
You won't find the native source code though, if that was what you meant
You won't find the native source code though, if that was what you meant
- xRedStar
- Skaarj Assassin
- Posts: 122
- Joined: 13 Jan 2013, 18:56
Subject: Re: UScript: Chat, Questions, Discussion
Post Posted: 30 Aug 2013, 06:00
I need help modifying the creatures properties, for some reason this stuff isn't affecting it what so ever. Idea was to have an infested monster swell up and change colors after health is low. Here is the code !!! PLEASE HELP
[spoiler]function Tick(float DeltaTime)
{
if ( health < 50 && health > 0 && bInfected == true && bOwnsMinions == false )
{
fatness=200;
bMeshEnviroMap=true;
texture=texture'UnrealShare.Effect7.MYTEX16';
return;
}
if ( health <= 0 || bOwnsMinions == false || bInfected == true)
{
Infestation();
super.Tick(DeltaTime);
return;
}
}[/spoiler]
[spoiler]function Tick(float DeltaTime)
{
if ( health < 50 && health > 0 && bInfected == true && bOwnsMinions == false )
{
fatness=200;
bMeshEnviroMap=true;
texture=texture'UnrealShare.Effect7.MYTEX16';
return;
}
if ( health <= 0 || bOwnsMinions == false || bInfected == true)
{
Infestation();
super.Tick(DeltaTime);
return;
}
}[/spoiler]
- Gizzy
- Skaarj Berserker
- Posts: 450
- Joined: 02 Feb 2010, 12:55
Subject: Re: UScript: Chat, Questions, Discussion
Post Posted: 30 Aug 2013, 10:43
xRedStar wrote:I need help modifying the creatures properties, for some reason this stuff isn't affecting it what so ever. Idea was to have an infested monster swell up and change colors after health is low. Here is the code !!! PLEASE HELP
[spoiler]function Tick(float DeltaTime)
{
if ( health < 50 && health > 0 && bInfected == true && bOwnsMinions == false )
{
fatness=200;
bMeshEnviroMap=true;
texture=texture'UnrealShare.Effect7.MYTEX16';
return;
}
if ( health <= 0 || bOwnsMinions == false || bInfected == true)
{
Infestation();
super.Tick(DeltaTime);
return;
}
}[/spoiler]
Try this instead:
Code: Select all
function CheckHealth()
{
If (Health < 50 && Health > 0 && bInfected == True && bOwnsMinions == False)
{
Fatness=200;
bMeshEnviroMap=true;
Texture=Texture'UnrealShare.Effect7.MYTEX16';
}
Else if (Health <= 0 || bOwnsMinions == False || bInfected == True)
Infestation();
}
Event Tick(float DeltaTime)
{
Super.Tick(DeltaTime);
CheckHealth();
}
- Buff Skeleton
- >:E
- Posts: 4173
- Joined: 15 Dec 2007, 00:46
Subject: Re: UScript: Chat, Questions, Discussion
Post Posted: 30 Aug 2013, 14:03
You should try to avoid using tick or repeating timers for anything that needs to be updated frequently. Use events like TakeDamage instead so that you aren't trying to process changes when none are occurring (nor do you miss changes if a timer or tick call gets dropped when the engine is struggling):
StartingHealth is just an int variable you calculate once in PostBeginPlay (StartingHealth = Health;). This will cover you in case any mutators, gametypes, or bIsBoss settings change the pawn's health after the game starts. oldhealth is also defined in the pawn class like StartingHealth.
Code: Select all
function TakeDamage( int Damage, Pawn instigatedBy, vector HitLocation, vector Momentum, name damageType)
{
Super.TakeDamage(Damage, instigatedBy, HitLocation, Momentum, damageType);
if( Health < StartingHealth * 0.25 && oldhealth > StartingHealth * 0.25 ) //if our health was previously above 25% but has now fallen below 25% then do this, etc
{
DoThingsHere(); // Update whatever it is you need to update based on current health
}
oldhealth = Health; //keep this at the bottom
}
StartingHealth is just an int variable you calculate once in PostBeginPlay (StartingHealth = Health;). This will cover you in case any mutators, gametypes, or bIsBoss settings change the pawn's health after the game starts. oldhealth is also defined in the pawn class like StartingHealth.
- xRedStar
- Skaarj Assassin
- Posts: 122
- Joined: 13 Jan 2013, 18:56
Subject: Re: UScript: Chat, Questions, Discussion
Post Posted: 30 Aug 2013, 20:45
I wasn't able to get the texture to change, that was the main issue. Before I added the bMeshEnviroMap and Texture line... the monster did change fatness. But once I added those two lines... the entire condition stopped working. If anyone here may be able to spot a fluke in the code I'm writing, hit me with it
I also took your suggestion and avoided the use of Tick(). It makes more sense to use the event and keep all of my conditions in seperate functions. For that, I apologize... I wrote this very sloppy.
Right here, you'll see the entire source. It is pretty simple, but I have a lot in store for it later. Just open the Spoiler to look at the contents inside...
[spoiler]//-----------------------------------------------------------
// m_krall is a manifest actor that adds a few mini body guards, and if the actor is infected. He will swell up and explode once low on health...
// He will also play multiple effects soon, but this is very early and unfinished code.
//
// Special Thanks to friends at UnrealSP for providing some additional support on the effects.
//-----------------------------------------------------------
class m_krall expands Krall;
var bool bOwnsMinions;
var bool bInfected;
function PreBeginPlay()
{
local float chances;
local BabyKrall BK;
chances = FRand();
super.PreBeginPlay();
if ( chances <= 0.8 && chances > 0.0 )
{
BK = Spawn(class'BabyKrall',self,,Location+VRand()*100,);
BK = Spawn(class'BabyKrall',self,,Location+VRand()*100,);
BK = Spawn(class'BabyKrall',self,,Location+VRand()*100,);
bOwnsMinions = true;
bInfected = false;
return;
}
else
bOwnsMinions = false;
bInfected = true;
return;
}
function Infestation()
{
local Pupae P;
if ( health <= 0 || bDeleteMe && bInfected == true)
{
P = Spawn(class'Pupae',,,Location+VRand()*100,);
P = Spawn(class'Pupae',,,Location+VRand()*100,);
P = Spawn(class'Pupae',,,Location+VRand()*100,);
P = Spawn(class'Pupae',,,Location+VRand()*100,);
P = Spawn(class'Pupae',,,Location+VRand()*100,);
P = Spawn(class'Pupae',,,Location+VRand()*100,);
bInfected = false;
Destroy();
return;
}
}
function CheckHealth()
{
If (Health < 50 && Health > 0 && bInfected == True && bOwnsMinions == False)
{
Fatness=200;
bMeshEnviroMap=true;
Texture=Texture'UnrealShare.Effect7.MYTEX16';
}
Else if (Health <= 0 || bOwnsMinions == False || bInfected == True)
Infestation();
}
Event Tick(float DeltaTime)
{
Super.Tick(DeltaTime);
CheckHealth();
}
DefaultProperties
{
}[/spoiler]
I also took your suggestion and avoided the use of Tick(). It makes more sense to use the event and keep all of my conditions in seperate functions. For that, I apologize... I wrote this very sloppy.
Right here, you'll see the entire source. It is pretty simple, but I have a lot in store for it later. Just open the Spoiler to look at the contents inside...
[spoiler]//-----------------------------------------------------------
// m_krall is a manifest actor that adds a few mini body guards, and if the actor is infected. He will swell up and explode once low on health...
// He will also play multiple effects soon, but this is very early and unfinished code.
//
// Special Thanks to friends at UnrealSP for providing some additional support on the effects.
//-----------------------------------------------------------
class m_krall expands Krall;
var bool bOwnsMinions;
var bool bInfected;
function PreBeginPlay()
{
local float chances;
local BabyKrall BK;
chances = FRand();
super.PreBeginPlay();
if ( chances <= 0.8 && chances > 0.0 )
{
BK = Spawn(class'BabyKrall',self,,Location+VRand()*100,);
BK = Spawn(class'BabyKrall',self,,Location+VRand()*100,);
BK = Spawn(class'BabyKrall',self,,Location+VRand()*100,);
bOwnsMinions = true;
bInfected = false;
return;
}
else
bOwnsMinions = false;
bInfected = true;
return;
}
function Infestation()
{
local Pupae P;
if ( health <= 0 || bDeleteMe && bInfected == true)
{
P = Spawn(class'Pupae',,,Location+VRand()*100,);
P = Spawn(class'Pupae',,,Location+VRand()*100,);
P = Spawn(class'Pupae',,,Location+VRand()*100,);
P = Spawn(class'Pupae',,,Location+VRand()*100,);
P = Spawn(class'Pupae',,,Location+VRand()*100,);
P = Spawn(class'Pupae',,,Location+VRand()*100,);
bInfected = false;
Destroy();
return;
}
}
function CheckHealth()
{
If (Health < 50 && Health > 0 && bInfected == True && bOwnsMinions == False)
{
Fatness=200;
bMeshEnviroMap=true;
Texture=Texture'UnrealShare.Effect7.MYTEX16';
}
Else if (Health <= 0 || bOwnsMinions == False || bInfected == True)
Infestation();
}
Event Tick(float DeltaTime)
{
Super.Tick(DeltaTime);
CheckHealth();
}
DefaultProperties
{
}[/spoiler]
- xRedStar
- Skaarj Assassin
- Posts: 122
- Joined: 13 Jan 2013, 18:56
Subject: Re: UScript: Chat, Questions, Discussion
Post Posted: 10 Sep 2013, 09:46
Thanks for all the support, btw... I got all of this fixed weeks ago. Or something like that, it was that the package wasn't in my compile list *facepalm*
- Gizzy
- Skaarj Berserker
- Posts: 450
- Joined: 02 Feb 2010, 12:55
Subject: Re: UScript: Chat, Questions, Discussion
Post Posted: 14 Oct 2013, 16:48
How do I go about selecting a random element from an array? I'm trying to code a mutator that replaces weapons listed in an array with weapons from another array (Configured by the user). At the moment I can replace "Weapons[i].OriginalWeapon" with "Weapons[i].ReplacementWeapon" (Where i = 0; i < 32; i++) but I don't know how to grab a random element from "Weapons[i].ReplacementWeapon"
Thanks
Thanks
- xRedStar
- Skaarj Assassin
- Posts: 122
- Joined: 13 Jan 2013, 18:56
Subject: Re: UScript: Chat, Questions, Discussion
Post Posted: 14 Oct 2013, 18:04
You may be able to do something like this...
for ( i = 0; i < 32; i++ )
{
FRand(i);
}
or try to make i = FRand() before the for statement... I am only guessing
for ( i = 0; i < 32; i++ )
{
FRand(i);
}
or try to make i = FRand() before the for statement... I am only guessing
- Buff Skeleton
- >:E
- Posts: 4173
- Joined: 15 Dec 2007, 00:46
Subject: Re: UScript: Chat, Questions, Discussion
Post Posted: 14 Oct 2013, 18:17
Gizzy wrote:How do I go about selecting a random element from an array? I'm trying to code a mutator that replaces weapons listed in an array with weapons from another array (Configured by the user). At the moment I can replace "Weapons[i].OriginalWeapon" with "Weapons[i].ReplacementWeapon" (Where i = 0; i < 32; i++) but I don't know how to grab a random element from "Weapons[i].ReplacementWeapon"
Thanks
Weapons[rand(Arraycount(Weapons))] is what you want.
- Gizzy
- Skaarj Berserker
- Posts: 450
- Joined: 02 Feb 2010, 12:55
Subject: Re: UScript: Chat, Questions, Discussion
Post Posted: 15 Oct 2013, 11:36
Bug Horse wrote:Gizzy wrote:How do I go about selecting a random element from an array? I'm trying to code a mutator that replaces weapons listed in an array with weapons from another array (Configured by the user). At the moment I can replace "Weapons[i].OriginalWeapon" with "Weapons[i].ReplacementWeapon" (Where i = 0; i < 32; i++) but I don't know how to grab a random element from "Weapons[i].ReplacementWeapon"
Thanks
Weapons[rand(Arraycount(Weapons))] is what you want.
Did the job perfectly, thanks guys
- xRedStar
- Skaarj Assassin
- Posts: 122
- Joined: 13 Jan 2013, 18:56
Subject: Re: UScript: Chat, Questions, Discussion
Post Posted: 30 Oct 2013, 14:57
I'm working on some AI Code lately, and I wanted to make smarter and tougher SkaarjOfficers that can strafe with shield up and also have regenerating shield belts if untouched by enemy fire. So in this situation I had an idea for them to find cover and in this process I sort of got mixed up in ideas of how this could work.
One of the ideas was to tell the AI to set random locations to move to until it finds a location that cannot be seen by the enemy. So basically, it iterates an algorithm that checks to see if the randomly picked location - enemy.location takes more than a single vector to be reached. As long as the Enemy isn't directly in the line of sight, it would be considered cover. On the other hand, once the AI reaches the location I want to try and measure the wall size to see if the AI is taller than the wall... and if he is then play function crouching() etc etc... in this case I was wondering if I could actually condition the amount of vectors it takes for the enemy to see the location of cover. And if I could measure the wall height to tell the AI to crouch, I also know that there is a LineofSight variable but IDK what it really does.
One of the ideas was to tell the AI to set random locations to move to until it finds a location that cannot be seen by the enemy. So basically, it iterates an algorithm that checks to see if the randomly picked location - enemy.location takes more than a single vector to be reached. As long as the Enemy isn't directly in the line of sight, it would be considered cover. On the other hand, once the AI reaches the location I want to try and measure the wall size to see if the AI is taller than the wall... and if he is then play function crouching() etc etc... in this case I was wondering if I could actually condition the amount of vectors it takes for the enemy to see the location of cover. And if I could measure the wall height to tell the AI to crouch, I also know that there is a LineofSight variable but IDK what it really does.
Who is online
Users browsing this forum: No registered users and 29 guests