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 … 10 11 12 13 14 … 18 Next »
Does that e2 function exist in starfall?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Threaded Mode
Does that e2 function exist in starfall?
22-12-2015, 08:37 PM,
#1
esitee Offline
you know
****
Posts: 60
Threads: 9
Joined: Dec 2014
Does that e2 function exist in starfall?
Hi, I already asked certain people, if theire is something like e2's
Code:
changed()
in starfall. I could imagine some situations where it would be pretty usefull.

If it ( or something that equals it ) doesn't already exists, could you please add it?

Thank you

[Image: ldkcVkq.jpg]
Find
Reply
22-12-2015, 08:53 PM, (This post was last modified: 22-12-2015, 08:55 PM by SuperPlayer.)
#2
SuperPlayer Offline
TSCM Super Member
****
Posts: 234
Threads: 30
Joined: Oct 2014
RE: Does that e2 function exist in starfall?
This function does not exist in Starfall because of how starfall works. If you need to check if some value has changed you will have to write your own function with if statements.
As an example( I know formatting is ugly, i am writing from my phone)

function changeState(Arg)
local NewState = Arg
-- Do stuff you want to do here
end

This function can be modified for any needs. If you have questions feel free to ask.


SuperPlayer
Find
Reply
22-12-2015, 09:04 PM,
#3
esitee Offline
you know
****
Posts: 60
Threads: 9
Joined: Dec 2014
RE: Does that e2 function exist in starfall?
Thank you Big Grin

[Image: ldkcVkq.jpg]
Find
Reply
22-12-2015, 11:03 PM,
#4
Person8880 Offline
gpj.ecafllorT
*******
Posts: 2,407
Threads: 45
Joined: Sep 2013
RE: Does that e2 function exist in starfall?
You shouldn't really be working like this in Starfall. You have events which tell you when "things" happen, and that's your point of change. If you find yourself constantly checking if values are changed you're usually doing something wrong.

For example, for wire inputs, you use the "input" event:
hook( "input", "OnInputChanged", function( Key, Value )
-- The input with name stored under Key now has the value stored under Value.
end )

There's plenty of events to get most changes you'd be interested in. Of course, there's a few cases where there's not an explicit event, but then we'd need to know what you're trying to accomplish to help more.
Find
Reply
23-12-2015, 10:08 AM,
#5
esitee Offline
you know
****
Posts: 60
Threads: 9
Joined: Dec 2014
RE: Does that e2 function exist in starfall?
Ok, thank you Person. This helps me a lot.

[Image: ldkcVkq.jpg]
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.