Team Spartan Cookies & Milk Forums
  • Issue Tracker
  • Donations
  • Search
  • Member List
  • Help

Register

Team Spartan Cookies & Milk Forums Garry's Mod Starfall v
« Previous 1 … 11 12 13 14 15 … 18 Next »
SF Editor Bug + Plane intersection question
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Threaded Mode
SF Editor Bug + Plane intersection question
04-10-2015, 11:09 PM,
#1
SuperPlayer Offline
TSCM Super Member
****
Posts: 234
Threads: 30
Joined: Oct 2014
SF Editor Bug + Plane intersection question
Hello!

I got a few problems with starfall again. First when i use the new day / night theme change it just changes the theme for half of the editor.
What i mean by that I am changing the the theme from Monokai to Chrome the editors color changes to white but the field where i enter the code keeps the Monokai theme.

Also i am trying to make a plane line intersect function for an emitter. But i keep getting this error:
sv: Player тѕсм.xXxANOxXx [GER] received error: SF:MF_Emitter.txt:73: attempt to call method 'Dot' (a nil value)

The functions I am using:

function Cursor()
LocalPlayer = ents.owner()
local Intersect = PlanLineIntersect( LocalPlayer:eyePos(), LocalPlayer:eyePos() + LocalPlayer:aimVector()*16800, Angles, Bridge:pos() + Bridge:getForward()*-60 + Bridge:getUp()*47 + Bridge:getRight()*190 )

render.setColor(255,0,0,255)
render.drawCircle(Intersect)
end

function PlanLineIntersect( lineStart, lineEnd, planeNormal, planePoint )
if lineStart == nil or lineEnd == nil or planeNormal == nil or planePoint == nil then error("Nil value") end
local t = planeNormalBig Grinot( planePoint - lineStart )/ planeNormalBig Grinot( lineEnd - lineStart )
return lineStart + t * ( lineEnd - lineStart )
end

--In the code Angles is:
Angles = Bridge:ang()
Angles:RotateAroundAxis( Bridge:right(), 90 )
Angles:RotateAroundAxis( Bridge:forward(), 90 )
Angles:RotateAroundAxis( Bridge:up(), 180 )

--And Bridge is:
ents.self:isWeldedTo()

Before that i wanted to use:
util.IntersectRayWithPlane( Vector rayOrigin, Vector rayDirection, Vector planePosition, Vector planeNormal ) 

But this doesnt exists in SF so is there another function like that?

[Image: banner_sgmgnlsa1.png]
Stargate Modding Group
Find
Reply
05-10-2015, 12:05 AM,
#2
TheOneAndOnlyTee Offline
GMod Admin
Posts: 755
Threads: 47
Joined: Oct 2013
RE: SF Editor Bug + Plane intersection question
Super i'm going to release the function that garbius coded ported to work with Link's button functions soon

Steam Profile
My Discord Server
Need help with E2 or SF? , just ask me and i'll try to help.
[Image: 98Dkcoz.gif]
Find
Reply
05-10-2015, 12:23 AM,
#3
SuperPlayer Offline
TSCM Super Member
****
Posts: 234
Threads: 30
Joined: Oct 2014
RE: SF Editor Bug + Plane intersection question
(05-10-2015, 12:05 AM)T-17 Wrote: Super i'm going to release the function that garbius coded ported to work with Link's button functions soon

Great! But i still would like to know what I am doing wrong in my code. You know... for learing and so

[Image: banner_sgmgnlsa1.png]
Stargate Modding Group
Find
Reply
05-10-2015, 12:30 AM,
#4
TheOneAndOnlyTee Offline
GMod Admin
Posts: 755
Threads: 47
Joined: Oct 2013
RE: SF Editor Bug + Plane intersection question
you've taken a different route since Garbius never used planeNormal() so i'm not sure if that'll work

Steam Profile
My Discord Server
Need help with E2 or SF? , just ask me and i'll try to help.
[Image: 98Dkcoz.gif]
Find
Reply
05-10-2015, 05:36 PM,
#5
Person8880 Offline
gpj.ecafllorT
*******
Posts: 2,407
Threads: 45
Joined: Sep 2013
RE: SF Editor Bug + Plane intersection question
A "normal" refers to a normalised vector (i.e. a vector whose length is 1). You're passing in an Angle object instead, which is why it's failing. Your normal should be Angles:Up().

As for the theme issue, are you using the correct theme name? It has to be all lowercase, and spaces have to be _ instead, so in your case: "monokai" and "chrome".
Find
Reply
« Next Oldest | Next Newest »


  • View a Printable Version
Forum Jump:


Users browsing this thread:
Contact UsTeam Spartan Cookies & MilkReturn to TopLite (Archive) ModeMark all forums readRSS Syndication

Powered By MyBB, © 2002-2026 MyBB Group.