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

Vector Error?
http://forums.datarealms.com/viewtopic.php?f=1&t=45828
Page 1 of 1

Author:  Mr_Rainbow [ Sun Oct 05, 2014 9:50 pm ]
Post subject:  Vector Error?

I seem to get this error when I use the M95 sniper from the General Industries Tech that I'm currently maintaining.


Any help would be great!

Thanks!

Author:  Rhyssia [ Mon Oct 06, 2014 4:00 am ]
Post subject:  Re: Vector Error?

SceneMan:CastObstacleRay Is being given too many...choices? It's stating that you have the following entered into the array
{SceneManager, Vector, Vector, Vector, Vector, Number, Number, Number}

Then it is telling you what the valid candidates/format are/is
{Vector, Vector, Vector, Vector, Number, Number, Number}

So it's just saying you need to remove the SceneManager: call from the array. (It has more information than it does spots to fill) if you could post the LUA to pastebin and PM me the link or post it in the reply I could help you trouble shoot it.

-Edit-
I think this *should* be the line thats throwing an error.

Code:
local dist = SceneMan:CastObstacleRay(self.Pos + self:RotateOffset(self.BipodOffset), Vector(0, user.Height * 0.5) , strikePoint, lastPoint, user.ID, -1, 0);


If you check here http://wiki.datarealms.com/SceneMan:CastObstacleRay It has a breakdown of what the array should look like.

-edit2+3-

(edit 3, changed the code to what i'm guessing is "moar" correct.)
This is what I'm guessing the line *should* look like.

Author:  CaveCricket48 [ Tue Oct 07, 2014 6:25 pm ]
Post subject:  Re: Vector Error?

The mod uses an older version of CastObstacleRay. The newer one has an argument for what team to ignore, so you have one too few arguments, not too many.

Depending on what the weapon is supposed to do, you could either set the team-to-ignore to -2 (no team), or self.Team, to prevent friendly fire.

Author:  Mr_Rainbow [ Thu Oct 09, 2014 12:05 am ]
Post subject:  Re: Vector Error?

CaveCricket48 wrote:
The mod uses an older version of CastObstacleRay. The newer one has an argument for what team to ignore, so you have one too few arguments, not too many.

Depending on what the weapon is supposed to do, you could either set the team-to-ignore to -2 (no team), or self.Team, to prevent friendly fire.


So what do I put exactly? It's a sniper rifle, the M95 in the mod, that's causing the problem. And I can't seem to find where to put what you said

Author:  CaveCricket48 [ Thu Oct 09, 2014 2:08 am ]
Post subject:  Re: Vector Error?

The arguments for CastObstacleRay are
Code:
SceneMan:CastObstacleRay(Vector1, Vector2, Vector3, Vector4, ID, Team, Material ID, Integer)


The one in the outdated code would look like
Code:
SceneMan:CastObstacleRay(Vector1, Vector2, Vector3, Vector4, ID, Material ID, Integer)



Add in the Team argument in the correct place. "self.Team" should work for the mod's purposes.

Author:  Mr_Rainbow [ Thu Oct 09, 2014 8:50 pm ]
Post subject:  Re: Vector Error?

CaveCricket48 wrote:
The arguments for CastObstacleRay are
Code:
SceneMan:CastObstacleRay(Vector1, Vector2, Vector3, Vector4, ID, Team, Material ID, Integer)


The one in the outdated code would look like
Code:
SceneMan:CastObstacleRay(Vector1, Vector2, Vector3, Vector4, ID, Material ID, Integer)



Add in the Team argument in the correct place. "self.Team" should work for the mod's purposes.


And this line of code would be located under what? Actors, effects ect? Sorry for being such a noob.

Author:  CaveCricket48 [ Fri Oct 10, 2014 1:24 am ]
Post subject:  Re: Vector Error?

Look for the code of where the weapon is. Since it's a sniper rifle, I'm going to assume it's somewhere where devices are.

Open the ini file for the gun, look for ScriptPath in the HDFirearm code or bullet code, find the Lua file, find instances of CastObstacleRay to fix.

Author:  Mr_Rainbow [ Fri Oct 10, 2014 2:19 am ]
Post subject:  Re: Vector Error?

CaveCricket48 wrote:
Look for the code of where the weapon is. Since it's a sniper rifle, I'm going to assume it's somewhere where devices are.

Open the ini file for the gun, look for ScriptPath in the HDFirearm code or bullet code, find the Lua file, find instances of CastObstacleRay to fix.


I found this.

Code:
SceneMan:CastObstacleRay(self.Pos + self:RotateOffset(self.BipodOffset), Vector(0, user.Height * 0.5) , strikePoint, lastPoint, user.ID, -1, 0);


I don't know what to change even with what you said.

Author:  Rhyssia [ Fri Oct 10, 2014 6:07 am ]
Post subject:  Re: Vector Error?

...lol
Try reading my other reply (The 2nd post) And see if that doesn't help.

Author:  Mr_Rainbow [ Fri Oct 10, 2014 8:17 pm ]
Post subject:  Re: Vector Error?

Rhyssia wrote:
...lol
Try reading my other reply (The 2nd post) And see if that doesn't help.


Derp. Lol I'll try what you said in a bit

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