Data Realms Fan Forums
http://forums.datarealms.com/

CastMORay and CastObstacle Ray new argument
http://forums.datarealms.com/viewtopic.php?f=73&t=31080
Page 2 of 2

Author:  Arcalane [ Mon Jun 04, 2012 5:15 pm ]
Post subject:  Re: CastMORay and CastObstacle Ray new argument

Probably better to update and remodify behaviour anyway, so you can take advantage of all the other tuneups to their overall intelligence and behaviour. :)

Now for something that's giving me grief. If anyone could help I'd greatly appreciate it.

Attachment:
Sights.zip [1008 Bytes]
Downloaded 369 times


The laser sight script (based off the Darkstorm sights) is attached to a MOSRot that is emitted from an AEmitter attached to the gun. A little roundabout, but I think it cuts down on the number of things running on the gun itself, and it seems to be pretty lightweight. It also means I don't have to make a script for each gun with a laser, which cuts filesizes down just a tiny bit.

The sniper scope script (Mehman's autoadjusting scope) is attached to the gun itself, and makes long-distance sniping easier since the sharpaim range adjusts very smoothly, rather than snapping back and forth.

Currently, both of them are spamming ObstacleRay-based errors, since they're not correctly getting the wielder's team. Which I have no idea how to fix myself, unfortunately. :???:

Author:  Gotcha! [ Mon Jun 04, 2012 10:47 pm ]
Post subject:  Re: CastMORay and CastObstacle Ray new argument

Well, almost all should be fixed in UniTec, but I am hoping to get help with two things:
Both the UniTec GL's sticky grenade (unitec.rte\devices\lua\Sticky Grenade.lua) and UniTec Needler (basically CaveCricket's needler, only crappier, unitec.rte\devices\lua\needle.lua) stick to friendlies, while my logic tells me that they should not. :???:

I found a bunch of these:
Code:
SceneMan:CastMORay(self.parentgun.MuzzlePos,Vector(self.detectrange,0):RadRotate(self.parent:GetAimAngle(true)),self.parent.ID,0,false,4)

and changed them to:
Code:
SceneMan:CastMORay(self.parentgun.MuzzlePos,Vector(self.detectrange,0):RadRotate(self.parent:GetAimAngle(true)),[color=#FF4000]self.Team[/color],self.parent.ID,0,false,4)

They should ignore friends, not? Am I on the wrong track?

Here's the mod so far: http://avatar.home.xs4all.nl/downloads/ ... _vtest.rar

Any help would be gawdawful much appreciated. :)

Author:  CaveCricket48 [ Mon Jun 04, 2012 11:12 pm ]
Post subject:  Re: CastMORay and CastObstacle Ray new argument

@Arcalane - change "self.team" to "self.Team" in line 9 of SniperScope.lua and that should fix it.
And try
Code:
dist = SceneMan:CastObstacleRay(self.Pos, checkVect, strikePoint, lastPoint, baseUserID, self.Team, -1, 0);

in place of line 21 in "LaserSightShort.lua".

@Gotcha - Switch "self.Team" and "self.parent.ID" and that should work.

Author:  Gotcha! [ Mon Jun 04, 2012 11:41 pm ]
Post subject:  Re: CastMORay and CastObstacle Ray new argument

CaveCricket, thank you so awful much. That did the trick!

I am going to name one of my future children after you. The handsome one.
I can already hear mom calling out to the streets: "Cave Cricket! Come inside. It's dinner time!"

Author:  Arcalane [ Tue Jun 05, 2012 4:10 am ]
Post subject:  Re: CastMORay and CastObstacle Ray new argument

Adjustable scope is working again, but the sights aren't projecting the dots. No errors in the console, but no dots either. :???:

Author:  CaveCricket48 [ Tue Jun 05, 2012 4:54 am ]
Post subject:  Re: CastMORay and CastObstacle Ray new argument

Oof, silly me. Line 8, change to:
Code:
local userID = SceneMan:CastMORay(self.Pos, checkVect, self.ID, -2, -1, false, 0);

See if that works.

Author:  Arcalane [ Tue Jun 05, 2012 5:02 am ]
Post subject:  Re: CastMORay and CastObstacle Ray new argument

Nailed it! Much better.

Now I can actually shoot straight again! :lol:

Author:  tfaal [ Thu Jun 07, 2012 4:41 pm ]
Post subject:  Re: CastMORay and CastObstacle Ray new argument

Wait, if you're implementing a new argument for an existing method, why in heaven's name wouldn't you put in a default value?

Author:  Daman [ Thu Jun 07, 2012 8:01 pm ]
Post subject:  Re: CastMORay and CastObstacle Ray new argument

If any of you understand these functions and their arguments, could you add them to the wiki? I don't really mod for CC any longer.

http://wiki.datarealms.com/index.php?ti ... &redlink=1

http://wiki.datarealms.com/index.php?ti ... &redlink=1

Anything you can put in those pages would be great! I can format it later!

Author:  Shook [ Fri Jun 08, 2012 9:49 pm ]
Post subject:  Re: CastMORay and CastObstacle Ray new argument

A'ight, i've managed to wrestle the two into submission, so i've gone ahead and added something. I apologize in advance for the terrible formatting. :-o

Page 2 of 2 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/