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

Register

Team Spartan Cookies & Milk Forums Garry's Mod Expression 2 v
1 2 3 4 5 … 8 Next »
vehicle's driver
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Threaded Mode
vehicle's driver
01-09-2017, 07:28 PM,
#1
CogHead Offline
TSCM Member
***
Posts: 20
Threads: 6
Joined: Jul 2017
vehicle's driver
Ok, so couldn't find anything with a quick search, so I have a question.

I'm trying to take the vehicle's driver, and use it for my chip. (taking it's screen parameters, checking for keypresses for controlling a menu)
My problem is, I can't seem to find a way to actually link the chip to the vehicle. (I don't want to weld it, becouse i want to keep every prop off the ship, that's not necessary for it being there)

I tried creating an entity link directly with the vehicle, or wiring it to the pod controller.
Right now, I just want to get the hud working for any driver. it works fine if I just use owner().
Code:
if(first() | changed(EGP)) { Driver=Chair:driver() W = egpScrW(Driver) H = egpScrH(Driver) . . (bla-bla-bla) . EGP:egpPos(99,vec2(W/100*50,H/100*80)) }
Find
Reply
01-09-2017, 11:34 PM,
#2
Knight Offline
Valued donator and member
****
Posts: 397
Threads: 21
Joined: Nov 2013
RE: vehicle's driver
Curious if linking a pod controller to the vehicle seat and then linking the chip to that pod controller to output the driver could be a solution? This is just speculation, you can try it in game and see if that solves the problem.




Find
Reply
02-09-2017, 05:30 PM,
#3
CogHead Offline
TSCM Member
***
Posts: 20
Threads: 6
Joined: Jul 2017
RE: vehicle's driver
After quite a bit of struggle, I believe I managed to solve my issue.
It seems the promblem lay in in the fact, that I took said vehecle's driver before anyone was sitting in it, and never updated that part. Since I couldn't quickly think of a way to update just that part of the code, I believe I managed to update it whenever the Pod changes state.
Code:
if(changed(Pod["Active",normal])) {reset()}
Although this seems obvious now, I'll leave this post here in case someone else is as shortsighted as I am.
I'm not sure I implemented the changed() function correctly, or that it does what I think it should, but the chip seems to work right now.
Find
Reply
« Next Oldest | Next Newest »


  • View a Printable Version
Forum Jump:


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

Powered By MyBB, © 2002-2026 MyBB Group.