Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
what are you guys talking about simfphys is still here!
I feel my best!
:
:
:
:
:
Here's how it's used in trailers reborn:
Addon adds callback to list of "FLEX" callbacks with id of "Trailers".
A table containing required data (connection positions and types + few optional ones) is added to car definition in simfphys vehicle definition list as a `FLEX { Trailers = { inPos = Vector(0,0,0) } }`
FLEX is just a simple script that will call trailers's callback with data of FLEX { Trailers }.
When car is spawn, "FLEX" loads car definition and checks if it has field named "FLEX".
If it does, it goes through every member checking if callback for it is registered, if it is, it runs it.
So...
vehicle is spawn -> load it's definition -> it has field named "FLEX" and it's a table (list of key and value pair) -> go through every member of this list -> check if there's a callback registered with same key -> call it.
list.Set("FLEX", "Test", function(entity, spawndata)
print(spawndata)
end)
-- somewhere in vehicle spawnlist
vehicle = {
-- ...
FLEX = {
Test = 12345
}
-- Members = {...}
}
ok!
Nice!