Nightmare v2.01 for Unreal - OBSOLETE: Get Limbo Instead
- Lightning Hunter
- Skaarj Elder
- Posts: 1291
- Joined: 11 Nov 2007, 22:12
- Location: Pervert.
Subject:
Post Posted: 05 Mar 2009, 21:42
I can give it a try - although I'm absolutely terrible at building Uscript from scratch. I understand code If I sit there and stare at it for a while, but it's hard putting together code from nothing.
- Lightning Hunter
- Skaarj Elder
- Posts: 1291
- Joined: 11 Nov 2007, 22:12
- Location: Pervert.
- Lightning Hunter
- Skaarj Elder
- Posts: 1291
- Joined: 11 Nov 2007, 22:12
- Location: Pervert.
Subject:
Post Posted: 12 Mar 2009, 09:27
Sorry for all the posts in a row... Waff, I came into contact with Asgard (found him through the OldUnreal forum in an Unreal difficulty enhancement thread), and he gave me the following code for a difficulty mutator:
You can adjust the default values using a config file with whatever values you want, such as this for example:
[Mymutator.Mymutator]
DamageScale=1.4
HealthScale=2.2
GroundspeedScale=2.0
AirspeedScale=2.0
His mutator is nice because you can play on the Unreal skill level with the proper amount of monsters, and have them be as hard as you like. However, the Nightmare mutator obviously has more work in the way of individual monster enhancements, rather than universally changing everything at once. Is there a way the two methods can be combined, so that the individual monster tweaks of the Nightmare mutator can work alongside Asgard's method of increasing the skill?
Code: Select all
class MyMutator extends Mutator config(MyMutator);
var() config float DamageScale;
var() config float HealthScale; // greater thatn one will increase, less decreases
var() config float GroundspeedScale;
var() config float AirspeedScale;
function bool CheckReplacement(Actor Other, out byte bSuperRelevant)
{
if (Other.IsA('scriptedpawn'))
{
scriptedpawn(Other).DamageScaling=scriptedpawn(Other).default.DamageScaling*DamageScale;
scriptedpawn(Other).health=scriptedpawn(Other).health*healthScale;
scriptedpawn(Other).groundspeed=scriptedpawn(Other).groundspeed*groundspeedScale;
scriptedpawn(Other).airspeed=scriptedpawn(Other).airspeed*airspeedScale;
//add whatever else
}
return true;
}
defaultproperties
{
DamageScale=1.0
HealthScale=1.0
GroundspeedScale=1.0
AirspeedScale=1.0
}
You can adjust the default values using a config file with whatever values you want, such as this for example:
[Mymutator.Mymutator]
DamageScale=1.4
HealthScale=2.2
GroundspeedScale=2.0
AirspeedScale=2.0
His mutator is nice because you can play on the Unreal skill level with the proper amount of monsters, and have them be as hard as you like. However, the Nightmare mutator obviously has more work in the way of individual monster enhancements, rather than universally changing everything at once. Is there a way the two methods can be combined, so that the individual monster tweaks of the Nightmare mutator can work alongside Asgard's method of increasing the skill?
- Buff Skeleton
- >:E
- Posts: 4173
- Joined: 15 Dec 2007, 00:46
Subject:
Post Posted: 12 Mar 2009, 16:28
Yeah, that's what I was talking about before. You should be able to replace the NightmareLevel with whatever value you want, not just 1 2 3 or 4, if you used stuff like that. I just didn't know how to do it.
That's a pretty slick mutator, though, and you may as well use that for the time being.
That's a pretty slick mutator, though, and you may as well use that for the time being.
- Lightning Hunter
- Skaarj Elder
- Posts: 1291
- Joined: 11 Nov 2007, 22:12
- Location: Pervert.
Subject:
Post Posted: 13 Mar 2009, 02:14
One really obvious problem of this mutator is that monsters like Titans take hundreds of rounds of ammo to kill. I can tell that their health value was modified independently in the Nightmare mutator to be lower. If only I could figure out a way to substitute "Nightmarelevel" in the code with something in this mod, so we don't have to redo all the balancing that has already been done.
- Lightning Hunter
- Skaarj Elder
- Posts: 1291
- Joined: 11 Nov 2007, 22:12
- Location: Pervert.
Subject:
Post Posted: 13 Mar 2009, 06:41
Asgard's mutator gave me an idea, but I couldn't quite get it right. I took the Nightmare NightMareNotify2, copied all the code in it, and pasted it in the Nightmare mutator section. I then modified the beginning of the code to look like this:
I thought that, in theory, the nightmare mutator should set the skill based on a config file, rather than the difficulty levels in the game. It doesn't seem to work quite right the way I have it, though... If I change the config file, it only seems to affect the health of monsters. It doesn't change the projectile speed, and probably other stuff as well. This following code doesn't seem to do anything anymore, for example:
I guess a few things are broken once it's not a subclass of SpawnNotify anymore.
Code: Select all
class Nightmare2 expands Mutator config(Nightmare);
var() config float NightmareLevel;
function PostBeginPlay()
{
local pawn pwn;
local projectile prj;
local inventory inv;
//find any existing pawns and projectile in the level first..
//(projectiles is unlikely, but meh)
foreach allactors(class'pawn',pwn){modifypawn(pwn);}
foreach allactors(class'projectile',prj){modifyprojectile(prj);}
foreach allactors(class'inventory',inv){modifyinventory(inv);}
super.postbeginplay();
}
//======================================================================
I thought that, in theory, the nightmare mutator should set the skill based on a config file, rather than the difficulty levels in the game. It doesn't seem to work quite right the way I have it, though... If I change the config file, it only seems to affect the health of monsters. It doesn't change the projectile speed, and probably other stuff as well. This following code doesn't seem to do anything anymore, for example:
Code: Select all
function modifyprojectile(projectile P)
{
if(p==none)
return;
if ( P.IsA('TentacleProjectile') )
{
TentacleProjectile(P).MaxSpeed = TentacleProjectile(P).Default.MaxSpeed+300.0+(200*NightmareLevel); // 800
setprojspeed(p,TentacleProjectile(P).Default.Speed+100.0+(200*NightmareLevel)); // 800
TentacleProjectile(P).Damage = TentacleProjectile(P).Default.Damage+10+(4*NightmareLevel); // 12
}
I guess a few things are broken once it's not a subclass of SpawnNotify anymore.
- Buff Skeleton
- >:E
- Posts: 4173
- Joined: 15 Dec 2007, 00:46
Subject:
Post Posted: 13 Mar 2009, 16:09
lol, yeah, being a subclass of SpawnNotify is pretty critical to its functionality!
You might be able to wrangle something, but condensing everything into a mutator definitely won't work.
You might be able to wrangle something, but condensing everything into a mutator definitely won't work.
- Lightning Hunter
- Skaarj Elder
- Posts: 1291
- Joined: 11 Nov 2007, 22:12
- Location: Pervert.
Subject:
Post Posted: 13 Mar 2009, 22:57
I've decided to basically re-write a mutator from scratch, but I'm running into a few problems. I'm still quite noobish at Uscript. This is the code I have so far, based on Asgard's code:
Everything above works like it should, except the stuff about the Tentacle Projectile. I tried writing the code about the TentacleProjectile in like 5 different ways, and each time it is ignored. Any ideas why? If someone can just point me in the right direction to get projectiles modified, I can continue to code the rest of the mutator with no problems. It seems that no matter how I change the projectile code, it always stays the default speed and damage.
Code: Select all
class limbo extends Mutator config(Limbo);
var() config float DamageScale;
var() config float HealthScale; // greater thatn one will increase, less decreases
var() config float GroundspeedScale;
var() config float AirspeedScale;
var() config float ProjectileSpeedScale;
var() config float SightRadiusScale;
function bool CheckReplacement(Actor Other, out byte bSuperRelevant)
{
if (Other.IsA('scriptedpawn'))
{
scriptedpawn(Other).DamageScaling=scriptedpawn(Other).default.DamageScaling*DamageScale;
scriptedpawn(Other).health=scriptedpawn(Other).health*healthScale;
scriptedpawn(Other).groundspeed=scriptedpawn(Other).groundspeed*groundspeedScale;
scriptedpawn(Other).airspeed=scriptedpawn(Other).airspeed*airspeedScale;
scriptedpawn(Other).projectilespeed=scriptedpawn(Other).projectilespeed*projectilespeedScale;
scriptedpawn(Other).SightRadius=scriptedpawn(Other).SightRadius*SightRadiusScale;
//Tentacle
Tentacle(Other).health=Tentacle(Other).default.health+45+(50*healthScale);
//This code is ignored. Why???
Tentacle(Other).projectilespeed=Tentacle(Other).default.projectilespeed+100+(20000*ProjectileSpeedScale);
if (Other.IsA('TentacleProjectile'))
TentacleProjectile(Other).Damage=TentacleProjectile(Other).Default.Damage+10+(400*DamageScale);
}
return true;
}
Everything above works like it should, except the stuff about the Tentacle Projectile. I tried writing the code about the TentacleProjectile in like 5 different ways, and each time it is ignored. Any ideas why? If someone can just point me in the right direction to get projectiles modified, I can continue to code the rest of the mutator with no problems. It seems that no matter how I change the projectile code, it always stays the default speed and damage.
- ividyon
- Administrator
- Posts: 2354
- Joined: 12 Nov 2007, 14:43
- Location: Germany
- Contact:
Subject:
Post Posted: 14 Mar 2009, 01:59
You're basically first checking if Other is a ScriptedPawn, and then go on to check if it's a TentacleProjectile in the same condition. Obviously a TentacleProjectile is not a ScriptedPawn, therefore that last check will never return positive results.
Try "else if" instead.
Try "else if" instead.
Code: Select all
class limbo extends Mutator config(Limbo);
var() config float DamageScale;
var() config float HealthScale; // greater than one will increase, less decreases
var() config float GroundspeedScale;
var() config float AirspeedScale;
var() config float ProjectileSpeedScale;
var() config float SightRadiusScale;
function bool CheckReplacement(Actor Other, out byte bSuperRelevant)
{
if (Other.IsA('scriptedpawn'))
{
scriptedpawn(Other).DamageScaling=scriptedpawn(Other).default.DamageScaling*DamageScale;
scriptedpawn(Other).health=scriptedpawn(Other).health*healthScale;
scriptedpawn(Other).groundspeed=scriptedpawn(Other).groundspeed*groundspeedScale;
scriptedpawn(Other).airspeed=scriptedpawn(Other).airspeed*airspeedScale;
scriptedpawn(Other).projectilespeed=scriptedpawn(Other).projectilespeed*projectilespeedScale;
scriptedpawn(Other).SightRadius=scriptedpawn(Other).SightRadius*SightRadiusScale;
//Tentacle
Tentacle(Other).health=Tentacle(Other).default.health+45+(50*healthScale);
//This code is ignored. Why??? <- No idea about that.
Tentacle(Other).projectilespeed=Tentacle(Other).default.projectilespeed+100+(20000*ProjectileSpeedScale);
}
else if (Other.IsA('TentacleProjectile'))
{
TentacleProjectile(Other).Damage=TentacleProjectile(Other).Default.Damage+10+(400*DamageScale);
}
return true;
}
UnrealSP.org webmaster & administrator
- Lightning Hunter
- Skaarj Elder
- Posts: 1291
- Joined: 11 Nov 2007, 22:12
- Location: Pervert.
Subject:
Post Posted: 14 Mar 2009, 04:44
Thanks for the response, Sana. The code still doesn't seem to work. The Tentacle Projectiles should be able to kill you in one hit if this code were working (I made the value extra high just to test if it was working on purpose). I think something must be wrong with the code altogether, but I'm not sure what...
Edit: Just realized the universal ProjectileSpeedScale value doesn't work, either. In other words, anything that tries to modify the projectile information doesn't work. I marked all the code that doesn't work:
Edit: Just realized the universal ProjectileSpeedScale value doesn't work, either. In other words, anything that tries to modify the projectile information doesn't work. I marked all the code that doesn't work:
Code: Select all
class limbo extends Mutator config(Limbo);
var() config float DamageScale;
var() config float HealthScale; // greater than one will increase, less decreases
var() config float GroundspeedScale;
var() config float AirspeedScale;
var() config float ProjectileSpeedScale; //ProjectileSpeedScale seems broken. Argh...
var() config float SightRadiusScale;
function bool CheckReplacement(Actor Other, out byte bSuperRelevant)
{
if (Other.IsA('scriptedpawn'))
{
scriptedpawn(Other).DamageScaling=scriptedpawn(Other).default.DamageScaling*DamageScale;
scriptedpawn(Other).health=scriptedpawn(Other).health*healthScale;
scriptedpawn(Other).groundspeed=scriptedpawn(Other).groundspeed*groundspeedScale;
scriptedpawn(Other).airspeed=scriptedpawn(Other).airspeed*airspeedScale;
//Broken as well... Why? Something is wrong with all the Projectile code. scriptedpawn(Other).projectilespeed=scriptedpawn(Other).projectilespeed*projectilespeedScale;
scriptedpawn(Other).SightRadius=scriptedpawn(Other).SightRadius*SightRadiusScale;
//Tentacle
Tentacle(Other).health=Tentacle(Other).default.health+45+(50*healthScale);
//This code is ignored. Why??? <- No idea about that.
Tentacle(Other).projectilespeed=Tentacle(Other).default.projectilespeed+100+(20000*ProjectileSpeedScale);
}
else if (Other.IsA('TentacleProjectile'))
{
TentacleProjectile(Other).Damage=TentacleProjectile(Other).Default.Damage+10+(400*DamageScale);
}
return true;
}
- Lightning Hunter
- Skaarj Elder
- Posts: 1291
- Joined: 11 Nov 2007, 22:12
- Location: Pervert.
Subject:
Post Posted: 14 Mar 2009, 12:59
I discussed this mutator with Usaar33 for a while tonight, and got quite a bit of coding done. I'm practically re-writing this entire mod, using only difficulty values of the Nightmare mutator as a base - so the mod will be the same difficulty as the Nightmare mutator was on Easy skill. In order to make this mod harder, you just modify the values in the config file. I might make a window in the Mod section of UT to change these values there.
I learned that changes projectile code are actually ignored in the mutator info. In order to make them work, I have to make a subclass of every monster projectile in the game, and then modify the code of each. The mutator then replaces the projectiles in the game with the new ones. This is what Usaar did in the OldSkool mod. The only reason the projectiles were modified for Waff's mod is because they were a subclass of SpawnNotify. The individual values were completely broken, however. This new method will take quite a bit of work, but will be worth it in the end.
I found quite a few bugs in the Nightmare mutator so far. One major bug was that any scriptedpawn in a map that had modified health and damage values was ignored. To see what I mean, just check out the Ice Skaarj (which is actually a SkaarjBerserker) in Extremedark. Due to the ".default" strings in the code, he has the stats of a normal Skaarj Berserker. In other words, he is no more powerful than a normal Skaarj Berserker while using the Nightmare mutator. I've fixed this bug by simply removing the .default portion of each line of code.
One bug I may not fix is the fact that the Skaarj Melee attacks are not modified by the mutator at all. This is also true with the Nightmare mutator. Lunge, Spin, and Claw all do the same amount of damage whether you have the nightmare mutator turned on or not. I won't fix this, becuase I figure the Skaarj do so much damage with Melee attacks already that there is no use.
Waff, after I finish coding this, do you want to collaborate and make this release together with a new name for the mod? I'm only requesting this since I'm re-writing most of it, and since it works in a completely different way. I could just release this under a different name altogether, but I wanted you to be involved since you made the original Nightmare mutator. My working title so far is "Limbo" - or in other words, "Hell". :p
I learned that changes projectile code are actually ignored in the mutator info. In order to make them work, I have to make a subclass of every monster projectile in the game, and then modify the code of each. The mutator then replaces the projectiles in the game with the new ones. This is what Usaar did in the OldSkool mod. The only reason the projectiles were modified for Waff's mod is because they were a subclass of SpawnNotify. The individual values were completely broken, however. This new method will take quite a bit of work, but will be worth it in the end.
I found quite a few bugs in the Nightmare mutator so far. One major bug was that any scriptedpawn in a map that had modified health and damage values was ignored. To see what I mean, just check out the Ice Skaarj (which is actually a SkaarjBerserker) in Extremedark. Due to the ".default" strings in the code, he has the stats of a normal Skaarj Berserker. In other words, he is no more powerful than a normal Skaarj Berserker while using the Nightmare mutator. I've fixed this bug by simply removing the .default portion of each line of code.
One bug I may not fix is the fact that the Skaarj Melee attacks are not modified by the mutator at all. This is also true with the Nightmare mutator. Lunge, Spin, and Claw all do the same amount of damage whether you have the nightmare mutator turned on or not. I won't fix this, becuase I figure the Skaarj do so much damage with Melee attacks already that there is no use.
Waff, after I finish coding this, do you want to collaborate and make this release together with a new name for the mod? I'm only requesting this since I'm re-writing most of it, and since it works in a completely different way. I could just release this under a different name altogether, but I wanted you to be involved since you made the original Nightmare mutator. My working title so far is "Limbo" - or in other words, "Hell". :p
- Buff Skeleton
- >:E
- Posts: 4173
- Joined: 15 Dec 2007, 00:46
Subject:
Post Posted: 14 Mar 2009, 17:44
Eh, just credit for the original idea and maybe the numbers would be OK, but the original numbers weren't even that well-tested, just best guesses! You can call it whatever you like. I'm glad to see you're taking the idea and running with it, though, and making something really worthwhile. This is why it's never a bad idea to release source code
- Lightning Hunter
- Skaarj Elder
- Posts: 1291
- Joined: 11 Nov 2007, 22:12
- Location: Pervert.
Subject:
Post Posted: 16 Mar 2009, 01:33
Does anyone know if the Skill setting for the Skaarj do anything? For example, a SkaarjBerserker has skill under AI set to "1.00000". I also noticed that Waffnuffly increased the skill further for the Nightmare mutator. Does this actually do anything?
One more question. Brute's have their projectilespeed defined in their own script, like this:
Is there any way to change this information in the mutator? The usual methods don't work, like this for example:
Also, making a subclass of the Brute Projectile (which is how I solved the problem for the other projectiles) doesn't work either. The Brute script seems to bypass both the BruteProjectile ProjectileSpeed, and the ProjectileSpeed located in the Brute's default properties. Any other way I can change it?
Edit: Nevermind about the Brute Projectile... the Projectile Subclass worked, I just missed a part of the code.
Still want to know what the Skill does for the Skaarj, though...
One more question. Brute's have their projectilespeed defined in their own script, like this:
Code: Select all
function PostBeginPlay()
{
Super.PostBeginPlay();
if (Skill > 1)
bLeadTarget = true;
if ( Skill == 0 )
ProjectileSpeed *= 0.85;
else if ( Skill > 2 )
ProjectileSpeed *= 1.1;
}
Is there any way to change this information in the mutator? The usual methods don't work, like this for example:
Code: Select all
function bool CheckReplacement(Actor Other, out byte bSuperRelevant)
{
if (Other.IsA('scriptedpawn'))
{
}
else if (Other.IsA('Brute'))
{
//This line is overwritten by the script. It doesn't do anything.
Brute(Other).ProjectileSpeed = Brute(Other).projectilespeed+5250+(50*projectilespeedscale); // 440.0
Also, making a subclass of the Brute Projectile (which is how I solved the problem for the other projectiles) doesn't work either. The Brute script seems to bypass both the BruteProjectile ProjectileSpeed, and the ProjectileSpeed located in the Brute's default properties. Any other way I can change it?
Edit: Nevermind about the Brute Projectile... the Projectile Subclass worked, I just missed a part of the code.
Still want to know what the Skill does for the Skaarj, though...
- Lightning Hunter
- Skaarj Elder
- Posts: 1291
- Joined: 11 Nov 2007, 22:12
- Location: Pervert.
Subject:
Post Posted: 23 Mar 2010, 18:55
In case anyone else is wondering where he got it:
http://www.unrealsp.org/forums/viewtopic.php?t=842
http://www.unrealsp.org/forums/viewtopic.php?t=842
Who is online
Users browsing this forum: No registered users and 43 guests