[Auto-Guiding Rockets] -- Beta 1

Discussions about Coding and Scripting
User avatar
papercoffee
Godlike
Posts: 10443
Joined: Wed Jul 15, 2009 11:36 am
Personal rank: coffee addicted !!!
Location: Cologne, the city with the big cathedral.
Contact:

Re: Auto-Guiding Rockets -- Are you satisfied now?

Post by papercoffee »

And now we are all taking a deep breath and drink a coffee or tee. (whatever floats your boat)

The title could be edited to get the little skits out of this conversation, which where present since the start of the thread. :wink:
User avatar
ANUBITEK
Adept
Posts: 261
Joined: Sun Dec 28, 2014 1:10 am
Location: Anubitek

Re: Auto-Guiding Rockets -- [WIP]

Post by ANUBITEK »

To add to all of this, there is already a mod that I believe you can use to swap projectiles and set projectile speed in UT99, I don't remember what it is called but I know I have it and you can find it if you look hard enough. And I'm willing to bet SmartRockets already has code that allows for SmartRockets to be fired out of nearly any gun (except hitscan guns I think), so I'd imagine it isn't too far removed from the realm of possibility these two existing mods have some sort of overlap. Maybe try to utilize these two mods instead of writing your own? Weapon mod arenas exist as well, so you can make it so every weapon on the map is a Pulse Gun (because Minigun is hitscan errrrggghhh), maybe make the Pulse Gun fire SmartRockets? These are just ideas, no idea if they work in practice, plus the mods have to be found for them so I could just be talking shit. At the very least, find these three mods and study their code. If anyone knows where to find these mods, can you link them? I don't remember where I found either of these three. You veterans HAVE to know what I am talking about.

On a tangential note, gonna agree with Sektor on this one honestly. At least with his overarching point of "stop posting broken code if broken code is broken." I get posting code for help in particular areas, but I'm not sure I've seen any packages come out of Gustavo that were working to a good degree, if they work at all. Don't get me wrong, it is good to experiment, but I've picked up some of his code that I wanted to see what it does but had to do enough maintenance just to get it to compile that I dropped the whole thing. My only suggestion is this: read more code homie. You seem like you need more practice if the pros are kicking in your proverbial door.

My stuff ain't perfect either, but I've got a compiled package together with code that does as it is intended. I grabbed a switch statement you made in my Fei Sprites topic to use it for handling sprite directions, only to have to do basic maintenance on the switch itself before sprite code even touched it due to having to compiler issues. Compare yours to mine, minor things but they add up quick:

Code: Select all

event SpriteAnimAdjust()
{
    local Rotator	ViewAngle;
    local Pawn P;
    local int i, Max;
    local float OldPosition;
	
    Max = Array_Size( Anims);
    for ( i=0 ; i<Max ; i++ )
    {
		if ( Anims[i].Animated != none && Anims[i].Animation != none && Anims[i].Animation.bDirectionalSprites == true )
		{
			ClientSpriteNum = (ViewAngle.Roll * 8) / 360;
			switch ClientSpriteNum
			{
			//=============================================================================
				case 1:
					Anims[i].Animation.CurrentSpriteDirection = SD_ForwardSprite;
					break;
			//=============================================================================
				case 2:
					Anims[i].Animation.CurrentSpriteDirection = SD_ForwardRightSprite;
					break;
			//=============================================================================
				case 3:
					Anims[i].Animation.CurrentSpriteDirection = SD_RightSprite;
					break;
			//=============================================================================
				case 4:
					Anims[i].Animation.CurrentSpriteDirection = SD_BackRightSprite;
					break;
			//=============================================================================
				case 5:
					Anims[i].Animation.CurrentSpriteDirection = SD_BackSprite;
					break;
			//=============================================================================
				case 6:
					Anims[i].Animation.CurrentSpriteDirection = SD_BackLeftSprite;
					break;
			//=============================================================================
				case 7:
					Anims[i].Animation.CurrentSpriteDirection = SD_LeftSprite;
					break;
			//=============================================================================
				case 8:
					Anims[i].Animation.CurrentSpriteDirection = SD_ForwardLeftSprite;
					break;
			//=============================================================================
				default:
					break;
			//=============================================================================
			}
		}
	}
}

Code: Select all

    //=============================================================================
    // RotationalSpriteActor.
    //=============================================================================
    class RotationalSpriteActor expands Actor;

    var(Sprites) Texture FrontSprite, FrontRightSprite, RightSprite, RearRightSprite, RearSprite, RearLeftSprite, LeftSprite, FrontLeftSprite;
    var byte ClientSpriteNum;

    function PreBeginPlay()
    {
        DrawType = DT_Sprite;
    }

    replication
    {
       reliable if (role == ROLE_Authority)
          FrontSprite, FrontRightSprite, RightSprite, RearRightSprite, RearSprite, RearLeftSprite, LeftSprite, FrontLeftSprite;
       unreliable if (role == ROLE_Authority)
          ClientSpriteNum;
    }

    function Tick(float Delta)
    {
       local Rotator ViewAngle;

       Super.Tick(Delta);
       //do the math

       //placeholder

       //end math estimation of life B-)

       ClientSpriteNum = (ViewAngle.Roll * 8) / 360

       switch ClientSpriteNum:
          case 1:
             Sprite = FrontSprite;
          case 2:
             Sprite = FrontRightSprite;
          case 3:
             Sprite = RightSprite;
          case 4:
             Sprite = RearRightSprite;
          case 5:
             Sprite = RearSprite;
          case 6:
             Sprite = HearLeftSprite;
          case 7:
             Sprite = LeftSprite;
          case 8:
             Sprite = FrontLeftSprite;
          default:
             log('Invalid ClientSpriteNum: ' + string(ClientSpriteNum) + ' Destroying actor...');
             Destroy();
    }

<<| http://uncodex.ut-files.com/ |>>

Code reference for UGold, UT99, Unreal2, UT2k3, UT3
Additional Beyond Unreal Wiki Links
wiki.beyondunreal.com/Legacy:Console_Bar
wiki.beyondunreal.com/Exec_commands#Load
wiki.beyondunreal.com/Legacy:Exec_Directive#Loading_Other_Packages
wiki.beyondunreal.com/Legacy:Config_Vars_And_.Ini_Files
wiki.beyondunreal.com/Legacy:INT_File
Terraniux
Masterful
Posts: 717
Joined: Mon Jan 05, 2009 8:08 pm
Personal rank: Banished member

Re: Auto-Guiding Rockets -- [WIP]

Post by Terraniux »

And now we are all taking a deep breath and drink a coffee or tee.
coffee is for the day and early eve, nighty night for tea :D
This member can only post when permitted.
Terraniux
Masterful
Posts: 717
Joined: Mon Jan 05, 2009 8:08 pm
Personal rank: Banished member

Re: Auto-Guiding Rockets -- [WIP]

Post by Terraniux »

Spank Terraniux for double post =1
Else = 0
This young "coder" unable to put up a script (even was telling me in private) but screwing info at Wiki seems to not learn lessons.
It's the same thing me learning bothpathing. Year by year I understand more. As O Thank you , sending me the updating thing on the CrystalRocks,
so should you thank you Gustavo for actually taking the effort for attempting something good.

There is no fault or no error or something abolutely false () with something to publish first.



A teacher can't give a grade without the student bringing his work in . Yet you need to work on your MANNERS Nelsona.
Ýou should have responded that message in a more appropriate way like the teacher does.
This member can only post when permitted.
MrLoathsome
Inhuman
Posts: 958
Joined: Wed Mar 31, 2010 9:02 pm
Personal rank: I am quite rank.
Location: MrLoathsome fell out of the world!

Re: Auto-Guiding Rockets -- [WIP]

Post by MrLoathsome »

LannFyre wrote:To add to all of this, there is already a mod that I believe you can use to swap projectiles and set projectile speed in UT99, I don't remember what it is called but I know I have it and you can find it if you look hard enough.
Swarmspawner can be configured to do that easily.....
blarg
User avatar
sektor2111
Godlike
Posts: 6403
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Auto-Guiding Rockets -- [WIP]

Post by sektor2111 »

Terraniux wrote:Yet you need to work on your MANNERS Nelsona
Not today but other day.
Terraniux wrote:As O Thank you , sending me the updating thing on the CrystalRocks
Your welcome but... I'm getting older, I forgot to fix ScreenShot for being visible in game menu... my bad... it was late and I could be tired...
User avatar
Gustavo6046
Godlike
Posts: 1462
Joined: Mon Jun 01, 2015 7:08 pm
Personal rank: Resident Wallaby
Location: Porto Alegre, Brazil
Contact:

Re: Auto-Guiding Rockets -- [WIP]

Post by Gustavo6046 »

I forgot where do I close this topic?
"Everyone is an idea man. Everybody thinks they have a revolutionary new game concept that no one else has ever thought of. Having cool ideas will rarely get you anywhere in the games industry. You have to be able to implement your ideas or provide some useful skill. Never join a project whose idea man or leader has no obvious development skills. Never join a project that only has a web designer. You have your own ideas. Focus on them carefully and in small chunks and you will be able to develop cool projects."

Weapon of Destruction
User avatar
papercoffee
Godlike
Posts: 10443
Joined: Wed Jul 15, 2009 11:36 am
Personal rank: coffee addicted !!!
Location: Cologne, the city with the big cathedral.
Contact:

Re: Auto-Guiding Rockets -- [WIP]

Post by papercoffee »

Gustavo6046 wrote:I forgot where do I close this topic?
You can't, ask a staff member to do it for you or just ignore it and stop posting in it.
Last edited by papercoffee on Thu Sep 08, 2016 12:41 am, edited 2 times in total.
User avatar
Gustavo6046
Godlike
Posts: 1462
Joined: Mon Jun 01, 2015 7:08 pm
Personal rank: Resident Wallaby
Location: Porto Alegre, Brazil
Contact:

Re: Auto-Guiding Rockets -- [WIP]

Post by Gustavo6046 »

papercoffee wrote:
Gustavo6046 wrote:I forgot where do I close this topic?
You can't ask a staff member to do it for you or just ignore it and stop posting in it.
papercoffee wrote:You can't ask a staff member to do it for you or just ignore it and stop posting in it.
xD

Do you know? I don't need this topic closed, exactly. I just want to stop this fight. This isn't any sort of "eternal arena" blabbering after all! But, this topic would be cool to discuss these rockets.

Example. my update on them:

Code: Select all

//=============================================================================
// AutoRocket.
//=============================================================================
class AutoRocket expands UT_SeekingRocket;

var()	float			SeekAcceleration, SeekSpeed, TargetAcquiringRadius, WallAvoidSpeed, WallPredictionFactor, WallAvoidSlowdown, ShootDensity, ShootDistance, ShootDistanceFactor;
var()	bool			bShootAtTarget, bIgnoreIgnorers;
var()	class<Actor>	ProjectileClass;
var		Pawn			User;
var		int				Slowdown;
var		bool			bFoundUser;

replication
{
	reliable if ( Role == ROLE_Authority )
		User,
		Slowdown,
		bFoundUser;
}

simulated event bool PercentChance(float Percentage)
{
	return FRand() * 100 < Percentage;
}

simulated event Vector EstimateLocation(Actor Other)
{
	return Other.Location + (Other.Velocity / VSize(Velocity)) * 0.5;
}

simulated event HomeAt(Actor Other)
{
	Velocity *= VSize(Velocity cross (EstimateLocation(Seeking) - Location)) * SeekAcceleration;
	Acceleration = (EstimateLocation(Seeking) - Location) * SeekSpeed;
}

simulated event Actor WillHitWall(optional out Vector Location, optional out Vector OutNormal)
{
	return Trace(Location, OutNormal, Self.Location + Velocity * WallPredictionFactor);
}

simulated event bool MonsterFriendly(ScriptedPawn Other)
{
	return Other != None && Other.AttitudeTo(User) == ATTITUDE_Friendly;
}

simulated event bool CheckSeekable(Pawn Other, Pawn FireAgent)
{
	return (
		Other != None
		&&
		(
			FireAgent == None
			||
			(
				FireAgent != None
				&& FastTrace(Other.Location)
				&& Other != FireAgent
				&& !Other.IsInState('Dying')
				&&
				(
					!MonsterFriendly(ScriptedPawn(Other))
					&&
					(
						Other.PlayerReplicationInfo == None
						|| FireAgent.PlayerReplicationInfo == None
						|| Other.PlayerReplicationInfo.Team != FireAgent.PlayerReplicationInfo.Team
					)
				)
			)
		)
	);
}

function BeginPlay()
{
	if ( Owner == None )
		return;

	if ( Pawn(Owner) != None )
		User = Pawn(Owner);

	else
		User = Pawn(Owner.Owner);

	if ( User == None )
		return;
}

simulated function SetTarget(Pawn Other)
{
	Seeking = Other;

	Log(self@"is now seeking after:"@Other);
}

simulated event Timer()
{
	local Pawn P;
	local Pawn Target;
	local Actor A;
	local Vector WallNorm, WallLoc;

	SetRotation(Rotator(Velocity));

	A = WillHitWall(WallLoc, WallNorm);

	if ( A != None && ( LevelInfo(A) != None || !CheckSeekable(Pawn(A), User) ) )
	{
		Velocity /= WallAvoidSlowdown;
		Slowdown *= WallAvoidSlowdown;
		Acceleration -= WallAvoidSpeed * 2 * (WallNorm dot Velocity) * WallNorm;
	}

	else if ( Slowdown > 1 )
	{
		Velocity *= Slowdown;
		Slowdown = 1;
	}

	else bFoundUser = True;

	if ( Seeking != None && FastTrace(Seeking.Location) && ( Pawn(Seeking) == None || !Pawn(Seeking).IsInState('Dying') || ScriptedPawn(Seeking) == None || ( User != None && ScriptedPawn(Seeking).AttitudeTo(User) == ATTITUDE_Friendly ) ) )
	{
		HomeAt(Seeking);

		if ( bShootAtTarget && PercentChance(ShootDensity) && ProjectileClass != None )
			Spawn(ProjectileClass, Owner, '', Location + Vector(Rotation) * (CollisionRadius + ShootDistance + ProjectileClass.default.CollisionRadius) * ShootDistanceFactor );
	}

	else if ( Seeking == None || !FastTrace(Seeking.Location) )
	{
		foreach RadiusActors(class'Pawn', P, TargetAcquiringRadius)
		{
			if ( Target == None || VSize(P.Location - Location) < VSize(Target.Location - Location) )
			{
				Target = P;

				if ( CheckSeekable(Target, User) )
					SetTarget(Target);
			}
		}
	}
}
If I recall correctly, I eliminated the Accessed Nones (so will you recover your manners now? :( ), the eternal enemy (after horse flies, of course!), and then I assembled some grenade launcher (or whatever projectile you want) to the rockets. :ironic:
"Everyone is an idea man. Everybody thinks they have a revolutionary new game concept that no one else has ever thought of. Having cool ideas will rarely get you anywhere in the games industry. You have to be able to implement your ideas or provide some useful skill. Never join a project whose idea man or leader has no obvious development skills. Never join a project that only has a web designer. You have your own ideas. Focus on them carefully and in small chunks and you will be able to develop cool projects."

Weapon of Destruction
User avatar
papercoffee
Godlike
Posts: 10443
Joined: Wed Jul 15, 2009 11:36 am
Personal rank: coffee addicted !!!
Location: Cologne, the city with the big cathedral.
Contact:

Re: Auto-Guiding Rockets -- [WIP]

Post by papercoffee »

Gustavo6046 wrote: xD
I fixed my post ...I'm a little bit drunk and go to bed now. :ironic:
User avatar
Dr.Flay
Godlike
Posts: 3347
Joined: Thu Aug 04, 2011 9:26 pm
Personal rank: Chaos Evangelist
Location: Kernow, UK
Contact:

Re: Auto-Guiding Rockets -- [WIP]

Post by Dr.Flay »

I know Gustavo can be very annoying Sektor, but can you please do me a favour, and repost here the item Number 1 from this page
https://www.ut99.org/viewtopic.php?f=1&t=149
There is a reason it is Number 1.
User avatar
sektor2111
Godlike
Posts: 6403
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Auto-Guiding Rockets -- [WIP]

Post by sektor2111 »

Dr.Flay wrote:I know Gustavo can be very annoying Sektor, but can you please do me a favour, and repost here the item Number 1 from this page
viewtopic.php?f=1&t=149
There is a reason it is Number 1.
Me, one, probably I'm gonna leave his "awesome" posts away, more than that I thought that rules have been changed while I was reading what was replying Darksonny which doesn't looks like is reading ALL things. Until this moment I don't see any functional mutator D-O-N-E but nothing original operational by Gusty, but a lot of spam and snippets, only confusing new coders. Darksonny seems OK with such posts, probably is cool to load only forum with no purpose - ah purpose is making members less interested about UT99.ORG. So this kinda null posting won't be interesting for me as well.
I'm drawing a conclusion: if you are doing something original small and functional that's not good.
If anyone else is spamming crap, doesn't have an age to be ON-Line according to EULA, tries to annoy STAFF and members, posting links to trash content and so on; then I demand to BAN the guy making functional things and revealing wrong things, and let spammers to load more crap as possible and loading "indictable content" BTW heading to "defaming" forum itself or this is not relevant... right ?. Probably one by one good people will stop reading this forum and With or Without me it will go in the same down-hill direction. Else I can see topics not only by me with words as: Ass, Fuck, Cunt, F... A... (masked but in the same way) and NONE was jumping high for them.

I'm gonna keep being honest as well (professional issue).
If I would held a forum and such prototypes would crawl there, since that so called BonusPack + age specific to mushrooms paranoia, he would be flew away in 10 seconds guaranteed. Because I don't have a problem toward language, but I have problems with useless trash spam.
User avatar
Hellkeeper
Inhuman
Posts: 903
Joined: Tue Feb 25, 2014 12:32 pm
Personal rank: Soulless Automaton
Location: France
Contact:

Re: Auto-Guiding Rockets -- [WIP]

Post by Hellkeeper »

sektor2111 wrote: Else I can see topics not only by me with words as: Ass, Fuck, Cunt, F... A... (masked but in the same way) and NONE was jumping high for them.
Maybe that's because they're not 100% disagreeable all the time
You must construct additional pylons.
JackGriffin
Godlike
Posts: 3774
Joined: Fri Jan 14, 2011 1:53 pm
Personal rank: -Retired-

Re: Auto-Guiding Rockets -- [WIP]

Post by JackGriffin »

Dr.Flay wrote:I know Gustavo can be very annoying Sektor, but can you please do me a favour, and repost here the item Number 1 from this page
https://www.ut99.org/viewtopic.php?f=1&t=149
There is a reason it is Number 1.
Oh the irony of Flay invoking the "rules". Are they only important when you need to enforce them on others? You deftly avoid any public discussion on the matter.... Fuck it, from now on you'll be KingFlay.
Image

You babies need to stop with Nelsona too. Yeah, he's a bit abrasive but he's also very right every time he calls out bullshit. You post broken code or untested work then you deserve to be grilled a little by him. Don't be so damn thin skinned about it. I swear this new bubble wrap culture is so afraid of dissent and disagreement...
Terraniux wrote:Ýou should have responded that message in a more appropriate way like the teacher does.
Why does the entire impetus of good behavior fall on Nelsona? I have nothing against Gus but Lann is right that he hasn't posted anything usable yet doesn't post them as such. Every single dev posting code will always say "I haven't tested this yet" if they haven't.
So long, and thanks for all the fish
User avatar
sektor2111
Godlike
Posts: 6403
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Auto-Guiding Rockets -- [WIP]

Post by sektor2111 »

Let me post even a few recalls about how a null byte stuck UnrealEngine - those "enum" which have a sudden affinity of people for them. They are similar to attitude byte and other custom defined which Gustavo was previously posting somewhere if memory doesn't cheat me. These bytes with null definitions are The Death of a server - no response. Well, he was speaking something about overheated PC if I well recall and that's why he cannot do tests. I'm convinced enough to think that his own codes are harming his computer because I was able to do mistakes like that - BUT NOT POSTED. So, when you fool with codes untested I'm gonna keep bitting and I'm not interested then about manners when such similar things are posted. When your mutator(s) are overheating machine and almost stuck it you should change codes and not asking for a tester for you :loool: .

As for other advices: if I would not be married, I would been looking for Women and Not Girls, and I have no affinity for any Joint - girls and joints are mainly for pedophiles on drugs (I guess) which Is not my case so anyone having such advices for me he ought to keep them for his friends and/or himself :thudown: . >> See Rule No. 1 in case of confusions.
Hellkeeper wrote:Maybe that's because they're not 100% disagreeable all the time
Maybe is true... even I recall when you were explaining a few mapping things which I read carefully but Mr. OmniCoder was laughing and talking his usual nonsenses probably another sort of language with meaning "THANKS for INFO"
viewtopic.php?f=5&t=6550&p=77324&hilit= ... ing#p77324
some of posts were like "you are an infuriating ass" if I well recall but admin forgot introduction for RULES in that time, right ?
Post Reply