I distinctly remember a gif, were the great Knorke produced a traffic jam..
Anybody willing/able to show me were to find this lua-wizzardry? The inquisition needs to aquire this for - scientrivic puroses
Knorkes Car Traffic System
Moderator: Moderators
- FireStorm_
- Posts: 666
- Joined: 19 Aug 2009, 16:09
Re: Knorkes Car Traffic System
Will post it when I get home but was not so much wizzardry:
Just units following waypoints.
Just units following waypoints.
- Funkencool
- Posts: 542
- Joined: 02 Dec 2011, 22:31
Re: Knorkes Car Traffic System
Then witchcraft perhaps?knorke wrote:Will post it when I get home but was not so much wizzardry:
Just units following waypoints.
Re: Knorkes Car Traffic System
- Attachments
-
- tinyskirmishredux.jpg
- (929.22 KiB) Downloaded 4 times
-
- screen00076.png
- (2.06 MiB) Downloaded 4 times
Re: Knorkes Car Traffic System
post reply..
you came home, but you forgot about code.. oh Knorke..
Thousands died a worrible death because of you not posting..

you came home, but you forgot about code.. oh Knorke..
Thousands died a worrible death because of you not posting..
Re: Knorkes Car Traffic System
MOM IAM SORRY.
I see you already have flying sky bonbons now?
---
At the top you can define many different sets of waypoints:Not sure why the table is bit silly with the [tn][1] like that, maybe I did not know better at the time?
Make sure each sets of waypoints forms a closed loop.
Units spawn at a random waypoint of the loop and continue from there.
Put your unit names here:The strange part with the for-loop is explained by comment and you can just remove it.
wtfisthisshit:
A counter how many units are alive or something. Do not know why so strange? But should not be too hard to make it less silly.
/edit:
Ah, I remember. The traffic cars unitdefs were "generated" and all named tpcar_number
I see you already have flying sky bonbons now?
---
At the top you can define many different sets of waypoints:
Code: Select all
local tn = "track1" --L hochstrasse
waypoints[tn] = {}
waypoints[tn][1] = {x=2880 , z=1091} --1
waypoints[tn][2] = {x=2920 , z=879} --
...
Make sure each sets of waypoints forms a closed loop.
Units spawn at a random waypoint of the loop and continue from there.
Put your unit names here:
Code: Select all
trafficUnitNames[1] = "redvan"
trafficUnitNames[2] = "whitevan"
trafficUnitNames[3] = "yellowvan"
wtfisthisshit:

Code: Select all
function gadget:UnitDestroyed(unitID, unitDefID, teamID, attackerID, attackerDefID, attackerTeamID)
local un = unitname (unitID)
--if (un == "whitevan" or un == "redvan" or un == "yellowvan" or un == "yellowbus") then
if (string.find(un, "tpcar_")) then
units[unitID] = nil
nUnits=nUnits-1
/edit:
Ah, I remember. The traffic cars unitdefs were "generated" and all named tpcar_number
- Attachments
-
- tp_traffic.lua
- (6.81 KiB) Downloaded 6 times