Knorkes Car Traffic System

Knorkes Car Traffic System

Discuss game development here, from a distinct game project to an accessible third-party mutator, down to the interaction and design of individual units if you like.

Moderator: Moderators

Post Reply
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10454
Joined: 24 Jan 2006, 21:12

Knorkes Car Traffic System

Post by PicassoCT »

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
User avatar
FireStorm_
Posts: 666
Joined: 19 Aug 2009, 16:09

Re: Knorkes Car Traffic System

Post by FireStorm_ »

I can not help by remembering when it was :-)

http://springrts.com/phpbb/viewtopic.ph ... start=8200
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Knorkes Car Traffic System

Post by knorke »

Will post it when I get home but was not so much wizzardry:
Just units following waypoints.
User avatar
Funkencool
Posts: 542
Joined: 02 Dec 2011, 22:31

Re: Knorkes Car Traffic System

Post by Funkencool »

knorke wrote:Will post it when I get home but was not so much wizzardry:
Just units following waypoints.
Then witchcraft perhaps?
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10454
Joined: 24 Jan 2006, 21:12

Re: Knorkes Car Traffic System

Post by PicassoCT »

Image
Attachments
tinyskirmishredux.jpg
(929.22 KiB) Downloaded 4 times
screen00076.png
(2.06 MiB) Downloaded 4 times
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10454
Joined: 24 Jan 2006, 21:12

Re: Knorkes Car Traffic System

Post by PicassoCT »

post reply..
you came home, but you forgot about code.. oh Knorke..

Thousands died a worrible death because of you not posting..


Image
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Knorkes Car Traffic System

Post by knorke »

MOM IAM SORRY.
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}  --
...
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:

Code: Select all

trafficUnitNames[1] = "redvan"
trafficUnitNames[2] = "whitevan"
trafficUnitNames[3] = "yellowvan"
The strange part with the for-loop is explained by comment and you can just remove it.

wtfisthisshit: :roll:

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
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
Attachments
tp_traffic.lua
(6.81 KiB) Downloaded 6 times
Post Reply

Return to “Game Development”