Joined: 24 Jan 2006, 21:12 Location: There is no god - and reality is his prophetess
Yep i "AtlasShrugged" on the ghostdancer.. as its now the hippster Thing to do. Oh, Atlases, you propably never heard of them
The unit will actually done by satan :D The concept is quite breathtaking :D Its basically.. the graphic representation of a horrortrip... its- one hit to death, but with chances... basically starts as 100% bulletproof and the chance of a lethal hit increases per second.. the problem is, every unit that shoots on it, gets speed set to zero. This is a RailGun. It Rails people into Nons.
Joined: 24 Jan 2006, 21:12 Location: There is no god - and reality is his prophetess
Needing some help here:
Code:
function CaveInLoop() while(true) do Spring.Echo("Terraformloop Active") while elementsInTable ~= 0 do Spring.Echo("table not empty") --get the randomized CaveInPoint
x=math.random(1,elementsInTable) Spring.Echo(elementsInTable) if terraFormTable[x][1]~= nil then xCaveIn=terraFormTable[x][1] Spring.Echo(xCaveIn) zCaveIn=(terraFormTable[x][2]) Spring.Echo(zCaveIn) Spring.Echo(yCaveIn) yCaveIn=(terraFormTable[x][3])-math.random(0,4) --get Spring to set the Terrain on CaveIn Spring.Echo(yCaveIn)
Spring.SetHeightMapFunc(function(x,z,y)
Spring.SetHeightMap(x,z,y,1)
end, xCaveIn, zCaveIn, yCaveIn )
table.remove(terraFormTable,x) elementsInTable=elementsInTable-1 end end sleep=math.random(400,1200) Sleep(sleep) end end
basically a loop which gets in a table precalculated points of the last railgun shot and then carves those into the landscape. Where did i go wrong? Sy and lua dont have a answer to this one, besides "the wiki knows it all".. googlefrog and knorke aint home.. so im asking here
Joined: 24 Jan 2006, 21:12 Location: There is no god - and reality is his prophetess
yep basically the railgun leaves craters shaped as lines. And as the ground is never really equal everywhere, the caveInValue is random.
I tried the examplecode yesterday.. and it definatly works, so the terraform system is not bugged but the way i hand over values into the function is wrong.
x,z,zOfOld=0 for i=15,range,1 do --calc point x=i+unitPosX z=(slope*x)+unitPosZ --modulu -if != yOfOld if zOfOld ~= (z-(z%1))then --getHeight add set point if height > unitPosX y=Spring.GetGroundHeight(x,z) if y > unitPosY then tempTable={} --add unitPosition tempTable[1]=x tempTable[2]=z tempTable[3]=y table.insert(terraFormTable,elementsInTable+1,tempTable) elementsInTable=elementsInTable+1
--yOfOld =y end zOfOld=z end
end
Well.. there is enough work otherwise. So now that this works. Time to get the Metalldiggester to run properly.
Attachments:
File comment: the potato has landed, i repeat the potato has landed screen00312.JPG [222.21 KiB]
Downloaded 4 times
Joined: 24 Jan 2006, 21:12 Location: There is no god - and reality is his prophetess
Well... as terraforming is expensive.. and i have many units doing it. I concluded packing all the terraforming into one gadget might be a good idea. So i programmed on a sort of LandLord Gadget. It collects the WaterHeightChanges and the Various Blended together HeightmapChanges (by DrillTrees and MetallDiggesters), computes a new Heightmap every 60 secs and applies the very same slowly.
And while iam at it, i also get the Efence Gadget done, it beeing basically a pathfinder, who getting units in circles, explores these "nodes" going out from the Wallbuilders, setting the explored nodes to "charged".
3 mins after i impemented this, the Dev Murphy is going to push finally_morph_Animations commit.. wow style Lava
Planning on using the distortion shadder over that.. if there ver was a shadder that fitted the occation better :D
One weekend went into that godamn volcano.. hope it was worth it in the end..
Joined: 24 Jan 2006, 21:12 Location: There is no god - and reality is his prophetess
Just realised today what a mess jw is currently: 3 gadgets.. none of them working properly.. electrify gadget to electrify e-fences terraformgadget (to apply mining excavations and mountains +waterlevel) headcrab gadget-> suppossed to spawn the headcrabs (which should attack people (WHICH THEY DO), which then should turn into zombies (WHICH THEY DONT)
All praise be upon Satans BugFixer.. the one that searches the infolog for my wrongdoings.
Todo: -- the volcano doesent work --get the headcrabs to spawn.. --get some eruptionssounds for the volcano.. (maybe something like a dragonroar..) --get in the other central buildings for the gameplay (those that enforce offensive gameplay (waterExtractor and waterGate)) --spend a week on refinements and bugfixxing get..get..get some sleep..
It would be 200% percent looking much better when spring would finaly support properly animation and not that obsolete TA-ish "animation" which we have for YEARS!
Joined: 22 Feb 2006, 01:02 Location: cheap kitchen
(unfinished, could be fancier)
i stole headcrab idea and made this:
Code:
local ZOMBO = "anything at all"
--config for killer,victim,zombie relation local zomba = { --when a scorpion kill a dude, the dude dies so hard he turns into a helicopter and converts to your team: [UnitDefNames["tpscorpion"].id] = {[UnitDefNames["tpdude"].id] = {unit=UnitDefNames["tphubschrauber"].id, killerTeam=true,}, } ,
--when a tank is destroyed (no matter by what) a dude escapes from it, like the technicans in C&C: [ZOMBO] = {[UnitDefNames["tptank"].id] = {unit=UnitDefNames["tpdude"].id, killerTeam=false,}, } ,
--jeep turns everything it kills into a new jeep (for its team) [UnitDefNames["tpjeep"].id] = {unit=UnitDefNames["tpjeep"].id, killerTeam=true,} ,
--headcrab creates new headcrab when killing a dude: -- [UnitDefNames["headcrab"].id] = {[UnitDefNames["dude"].id] = {unit=UnitDefNames["headcrab"].id, killerTeam=true,}, } , }
function gadget:UnitDestroyed(unitID, unitDefID, teamID, attackerID, attackerDefID, attackerTeamID) local result = nil if (zomba[attackerDefID]) then if zomba[attackerDefID][unitDefID] then result = zomba[attackerDefID][unitDefID] else result = zomba[attackerDefID] end end
if (result==nil and zomba[ZOMBO]) then result = zomba[ZOMBO][unitDefID] end
if (result) then local x,y,z = Spring.GetUnitPosition (unitID) if (result.killerTeam) then teamID = attackerTeamID end Spring.CreateUnit (result.unit, x,y,z, 0, teamID) end end
(that works if you replace unitnames and c&p the gadget:GetInfo() stuff on top)
can config it like this:
Code:
--when this kills something, creates this: -- v v --zomba[attacker] = result
--also possible: --when this kills this creates this -- v v v --zomba [attacker][victim] = result
--when something should turn into a new thing, no matter what killed it: -- anything kills this creates this -- v v v --zomba[ZOMBO][victim] = result
killerTeam = true / false new unit is on killer's team or original team
Joined: 24 Jan 2006, 21:12 Location: There is no god - and reality is his prophetess
im doing it right? Thanks knorke. Loads of work done better then my hax.
Code:
function gadget:GetInfo() return { name = "OverHeadCrab", desc = "", author = "jK - always jk is there anyhting lua, that he didnt do long before you, making you look like a idiot in his fathers shoes. :(. Haha, this time its mainly copied from knorke : )", date = "Sep. 2008", license = "GNU GPL, v2 or later", layer = 0, enabled = true, } end
if (gadgetHandler:IsSyncedCode()) then
gaiaTeamID=Spring.GetGaiaTeamID() local ZOMBO = "anything at all" //This part sends them too hell
--config for killer,victim,zombie relation local zomba = { --when a scorpion kill a dude, the dude dies so hard he turns into a helicopter and converts to your team: [UnitDefNames["headcrab"].id] = {[UnitDefNames["bg"].id] = {unit=UnitDefNames["zombie"].id, killerTeam=true,}, } , [UnitDefNames["headcrab"].id] = {[UnitDefNames["tiglil"].id] = {unit=UnitDefNames["zombie"].id, killerTeam=true,}, } , [UnitDefNames["headcrab"].id] = {[UnitDefNames["css"].id] = {unit=UnitDefNames["zombie"].id, killerTeam=true,}, } , [UnitDefNames["headcrab"].id] = {[UnitDefNames["skinfantry"].id] = {unit=UnitDefNames["zombie"].id, killerTeam=true,}, } ,
--when a tank is destroyed (no matter by what) a dude escapes from it, like the technicans in C&C: [ZOMBO] = {[UnitDefNames["restrictor"].id] = {unit=UnitDefNames["bg"].id, killerTeam=false,}, } , [ZOMBO] = {[UnitDefNames["mtw"].id] = {unit=UnitDefNames["bg"].id, killerTeam=false,}, } , [ZOMBO] = {[UnitDefNames["ampro"].id] = {unit=UnitDefNames["bg"].id, killerTeam=false,}, } ,
--jeep turns everything it kills into a new jeep (for its team) --[UnitDefNames["tpjeep"].id] = {unit=UnitDefNames["tpjeep"].id, killerTeam=true,} ,
--headcrab creates new headcrab when killing a dude: -- [UnitDefNames["headcrab"].id] = {[UnitDefNames["dude"].id] = {unit=UnitDefNames["headcrab"].id, killerTeam=true,}, } , }
function gadget:UnitDestroyed(unitID, unitDefID, teamID, attackerID, attackerDefID, attackerTeamID) local result = nil if (zomba[attackerDefID]) then if zomba[attackerDefID][unitDefID] then result = zomba[attackerDefID][unitDefID] else result = zomba[attackerDefID] end end
if (result==nil and zomba[ZOMBO]) then result = zomba[ZOMBO][unitDefID] end
if (result) then local x,y,z = Spring.GetUnitPosition (unitID) if (result.killerTeam) then teamID = gaiaTeamID end Spring.CreateUnit (result.unit, x,y,z, 0, teamID) end end
//THis part watches for shell
local headCrabWeapon = {}
for i=1,#WeaponDefs do local wd = WeaponDefs[i]
if (wd.description:find("HeadCrab-Shell")) then Script.SetWatchWeapon(wd.id,true) headCrabWeapon[wd.id] = true end end
function gadget:Explosion(weaponID, px, py, pz) if (headCrabWeapon[weaponID]) then Spring.CreateUnit("hc",px,py,pz, 0, gaiaTeamID) end
and put it in gadget:Initialize(), having stuff (beside global declarations outside) is appearently bad. For example it won't allow the gadget to be disabled completly.
Joined: 22 Feb 2006, 01:02 Location: cheap kitchen
forgott that when when canceling unit contruction in a factory it calls UnitDestroyed. So add something like:
Code:
function gadget:UnitDestroyed(unitID, unitDefID, teamID, attackerID, attackerDefID, attackerTeamID) if (not finishedUnits[unitID]) then return end ... finishedUnits[unitID] = nil end
--checking buildprogess==1 in UnitDestroyed does not work local finishedUnits = {} function gadget:UnitFinished(unitID, unitDefID, teamID) finishedUnits[unitID] = true end
Joined: 24 Jan 2006, 21:12 Location: There is no god - and reality is his prophetess
knorke wrote:
forgott that when when canceling unit contruction in a factory it calls UnitDestroyed. So add something like:
Code:
function gadget:UnitDestroyed(unitID, unitDefID, teamID, attackerID, attackerDefID, attackerTeamID) if (not finishedUnits[unitID]) then return end ... finishedUnits[unitID] = nil end
--checking buildprogess==1 in UnitDestroyed does not work local finishedUnits = {} function gadget:UnitFinished(unitID, unitDefID, teamID) finishedUnits[unitID] = true end
? So, if a unit would be chanceled, a little guy would leave--> infinite infantry? but why does buildprogress not work- the unit still exists when this is called.
Joined: 24 Jan 2006, 21:12 Location: There is no god - and reality is his prophetess
no recent posts due to reasons advances beeing to fast: stuff that now works (ocassionaly): Headcrabs finding bodys.. spawning zombies.. zombies attacking nearest enemys... building leaving wreckages and running civilians.. civilians leaving dead bodys
also worked on the beanstalk growth animation... well it works, but the modell sucks.. goes back into the forge.. TodoList: TerraInForm-Gadget -> Volcano J-Shadow J-Beherith The Electricity Gadget The spawn a Headcrab at shell impact Gadget (Yes, i suck at gadgetmaking-> recent Advances are mostly due to copying from jK and knorke) the genericInfantryBody needs a new description "Memento Mori" would be fitting.
Users browsing this forum: No registered users and 0 guests
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum