smoth's junk. - Page 10

smoth's junk.

Share and discuss visual creations and creation practices like texturing, modelling and musing on the meaning of life.

Moderators: MR.D, Moderators

User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: smoth's junk.

Post by smoth »

gajop wrote:so still not sure; are these team colors or team + tank colors?
if those are just team colors, it seems kinda hard to distinguish between 2nd and 3rd tank type
I have(since I think grts 1.0) and always will use health bars and teamplatters for team color. I only ever used it on 3dos(which were years old) and buildings.
jK wrote:imo make another more hi-poly (5k-10k) model of it to generate a normalmap with nvidia's `melody` tool.
I don't know how. But so far I am happy with these results.
jK wrote:Also the texture seems to have mipmap overlapping
do tell? can you mark the image where you are seeing this?
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Re: smoth's junk.

Post by rattle »

I prefer my tanks in shades of grey.. or throbbing meat
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10450
Joined: 24 Jan 2006, 21:12

Re: smoth's junk.

Post by PicassoCT »

The meat part i can understand.. but grey..oh right, germany.. we aint allowed colour yet, besides brown or olive. If we get red flags again...
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: smoth's junk.

Post by smoth »

grey blends in too well with the surroundings. I will have grey units but these units in particular are meant to be these colors.

the black one is used for riot suppression
the tan one is fire support and tan and blue because it is more interesting looking
the green is a MBT

Anyway there will be grey-ish mechs but I'll probably stay away from battleship grey.
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10450
Joined: 24 Jan 2006, 21:12

Re: smoth's junk.

Post by PicassoCT »

big apology to the ghrey-comunity. This is not a discrimination, rather a unfortunate expression of personal taste. Rest assured that in any other spring game, ghrey-units, if expertise is equal are choosen more often. If possible in combination with greyish-brown underground. And grey-brownish sky.

Tank you. ;)
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: smoth's junk.

Post by smoth »

Image

this is what a unit looks like without the colors applied.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: smoth's junk.

Post by smoth »

From left to right.
Image
wolf spider: single vulcan
huntsman: Energy cannon

Image
Bola: kinetic munitions, smoke grenades
tarantula: twin linked energy cannon(fires 2 energy shots at 1 time)
birdkiller: slaved twin vulcans with independent vulcan mounted on top.

all 5 tanks, and their variant weapons systems are supported by 1 script

Code: Select all

-------------------------------------------------------
-- License:	Public Domain
-- Author:	Steve (Smoth) Smith
-- Date:	11/27/2012
-------------------------------------------------------

-- Piece names
base		= piece 'base'
local treadCount	= 4
	
weaponBarrel	= {}
weaponSleeve	= {}
weaponPiece		= {}
twinLinkedPiece		= {}
weaponTurret	= {}
tankTreads		= {} 
	


-- State variables
isMoving, isAiming = false, false

local spGetUnitDefID	= Spring.GetUnitDefID
local unitWeapons		= {}

-- Signal definitions
local SIG_AIM	=	{2,4,8,16}

-- effects for emitters
local effectA = 1024


local function TreadAnimations()
	local treadnum = 1
	local lastTread = treadCount
	
	-- get all my treads.
	local counter	= 1
	while ( counter-1 < treadCount ) do
		--Spring.Echo("treads"..counter)
		tankTreads[counter]	= piece ("treads"..counter)
		counter = counter +1
	end
	--	Spring.Echo("tread count: " .. counter)
	
	-- hide all tank treads
	for treadNumber,_ in pairs(tankTreads) do
		if treadNumber ~= lastTread then
			Hide (tankTreads[treadNumber])
		end
	end		
	
	while( 1 ) do
		-- moving animation
  		if(isMoving == true) then
			--Spring.Echo(treadnum, lastTread)
			Hide (tankTreads[lastTread])
			Show (tankTreads[treadnum])
			
			lastTread	= treadnum
			
			treadnum = treadnum + 1
		
			if( treadnum == treadCount+1) then
				treadnum = 1
			end
		end
		Sleep (50)
	end
end


function script.StartMoving()
	isMoving = true
end

function script.StopMoving()
	isMoving = false
end	
	
local function getWeaponData()
	weapons	= UnitDefs[spGetUnitDefID(unitID)].weapons
	local counter = 1

	for k,v in pairs(weapons) do
		Spring.Echo(" --= weapon number: " .. counter .. " =-- ")		
		unitWeapons[counter]	= {}
		
		if WeaponDefs[v.weaponDef].customParams.abilityweapon then
			unitWeapons[counter].abilityWeapon	= WeaponDefs[v.weaponDef].customParams.abilityweapon
			weaponPiece[counter]	= base
			weaponBarrel[counter]	= base
		else
			-- twinlinked covers when we have two barrels firing at 1 time
			-- (such as a double barrel shotgun)
			if WeaponDefs[v.weaponDef].customParams.twinlinked then
				twinLinkedPiece[counter]	= piece ("weapon".. counter .. "_a_2")
				Spring.Echo("    weapon".. counter .. "_a_2")
			end
				weaponPiece[counter]	= piece ("weapon".. counter .. "_a_1")
				Spring.Echo("    weapon".. counter .. "_a_1")
			
			
			
									
			weaponBarrel[counter]	= piece ("weapon".. counter .. "_a_barrel")
			--Spring.Echo("    weaponBarrel: weapon".. counter .. "_a_barrel")
			weaponSleeve[counter]	= piece ("weapon".. counter .. "_a_sleeve")
			--Spring.Echo("    weaponSleeve: weapon".. counter .. "_a_sleeve")	
			
			if v.slavedTo ~= 0 then
				unitWeapons[counter].slave = v.slavedTo
				--Spring.Echo("slaveto", unitWeapons[counter].slave)
			else
				weaponTurret[counter] = piece ("weapon".. counter .. "_turret")
				--Spring.Echo("    weapon".. counter .. "_turret")
			end
		end

		if WeaponDefs[v.weaponDef].customParams.animation then
			unitWeapons[counter].animation	= WeaponDefs[v.weaponDef].customParams.animation
		end
		counter		= counter +1
	end
end

--------------------------------------------------------
--start ups :)
--------------------------------------------------------
function script.Create()
	-- Initial State

	StartThread(TreadAnimations)
	
	getWeaponData()
end

function script.AimFromWeapon(weaponID)
	return	weaponBarrel[weaponID]
end

function script.QueryWeapon(weaponID)
	return weaponPiece[weaponID]		
end
		
-----------------------------------------------------------------------
--gun functions;
-----------------------------------------------------------------------	

-----------------------------------------------------------------------
-- This coroutine is restarted with each time a unit reaims, 
-- not the most efficient and should be optimized. Possible
-- augmentation needed to lus.
-----------------------------------------------------------------------
local function RestoreAfterDelay(weaponID)
	Sleep(1000)

	if (unitWeapons[weaponID].animation  == "spinup")then		
		StopSpin (weaponBarrel[weaponID], z_axis, math.rad(50)) 
	end

	if(unitWeapons[weaponID].slave == nil) then
		Turn(weaponTurret[weaponID], y_axis, 0, math.rad(90))
		WaitForTurn(weaponTurret[weaponID], y_axis)
	end
	
	Turn(weaponSleeve[weaponID], x_axis, 0, math.rad(100))	
	WaitForTurn(weaponSleeve[weaponID], x_axis)
end


function script.AimWeapon(weaponID, heading, pitch)
	if(unitWeapons[weaponID].abilityWeapon) then
		return false
	end
	Signal(SIG_AIM[weaponID])
	SetSignalMask(SIG_AIM[weaponID])
	
	if (unitWeapons[weaponID].animation  == "spinup")then		
		Spin(weaponBarrel[weaponID], z_axis, 20) 
	end
	
	if(unitWeapons[weaponID].slave == nil) then
		--Spring.Echo(weaponID, unitWeapons[weaponID].slave)
		Turn(weaponTurret[weaponID], y_axis, heading, math.rad(20))	
		WaitForTurn(weaponTurret[weaponID], y_axis)
	end
	
	Turn(weaponSleeve[weaponID], x_axis, 0 - pitch, math.rad(100))

	WaitForTurn(weaponSleeve[weaponID], x_axis)
	StartThread(RestoreAfterDelay, weaponID)
	
	return true
end

function LaunchSmoke()
	EmitSfx(piece 'smoke', 2049)
end
	
function script.Shot(weaponID) 
	if (unitWeapons[weaponID].animation  == "recoil")then		
		Move(weaponBarrel[weaponID], z_axis,  -1)
		EmitSfx(weaponPiece[weaponID], 1025)
		Move(weaponBarrel[weaponID], z_axis, 0, 1)
	else
		EmitSfx(weaponPiece[weaponID], 1025) 
	end	
	
	-- if we have a twin linked barrel to fire
	if twinLinkedPiece[weaponID] then
		EmitSfx(twinLinkedPiece[weaponID], 2048)
		EmitSfx(twinLinkedPiece[weaponID], 1025) 
	end
end
	
function script.Killed(recentDamage, maxHealth)
	local severity = recentDamage/maxHealth
	if (severity <= 99) then
		return 3
	else
		return 0
	end
end
(the above code is work in progress but I wanted to show it off, get over it) :P
also, in before store in gg. table.. I will, when I am done. Right now, this is the easier way.
User avatar
Funkencool
Posts: 542
Joined: 02 Dec 2011, 22:31

Re: smoth's junk.

Post by Funkencool »

Neat stuff
Will the smoke grenades effect LOS or accuracy? That would be pretty handy, maybe they could be tied to a retreat command? It would be cool see something similar in air, like flairs perhaps.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: smoth's junk.

Post by smoth »

Smoke grenades hide units by turning them stealth, any unit in them is at best a radar blip to it's enemy. The units in the smoke take an accuracy penalty.

Sight flairs are not really something I am doing until I toy with nighttime options.
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10450
Joined: 24 Jan 2006, 21:12

Re: smoth's junk.

Post by PicassoCT »

smoth wrote:Image

this is what a unit looks like without the colors applied.
ripped from halo?

I have nothing negative to say about the tanks, so i make something up.
People can oversee around twelfe diffrent units (and there purposes -> sc, etcc ), you put 5 into the tank. (No, even in BA, most units only appear rarely)
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: smoth's junk.

Post by smoth »

Image

so my script supports this now to >:)
LordMuffe
Posts: 286
Joined: 13 Mar 2005, 15:39

Re: smoth's junk.

Post by LordMuffe »

don´t know why, but I somehow get reminded of EE when i look at those tanks... not a bad thing, mind you... :)

the independent vulcan on the birdkiller: is its rotation-center on the same axis as the main turret?
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: smoth's junk.

Post by smoth »

Image
FINALLY created something crazy enough to break my script >:D I present to you "the Alot"
User avatar
Erik
Posts: 283
Joined: 20 Aug 2009, 20:49

Re: smoth's junk.

Post by Erik »

Almost enough dakka.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6240
Joined: 29 Apr 2005, 01:14

Re: smoth's junk.

Post by FLOZi »

I take it I have converted you to my way of thinking wrt scripts then, Smoth? :wink:
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: smoth's junk.

Post by smoth »

yeah
User avatar
Das Bruce
Posts: 3544
Joined: 23 Nov 2005, 06:16

Re: smoth's junk.

Post by Das Bruce »

Can you outline what's different for your script? I'd read it but I'm pressed for time and lazy.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: smoth's junk.

Post by smoth »

essentially I am using piecenames and table generation to automagically cover different types of tanks. I use custom parameters to add extra stuff like animations or behaviors. The script reads all this and assembles tables at the unit creation call to get weapon data and bam instead of 100+ lines to cover 14 weapon you have a single block. the idea is to get it where I can just make model and def, then the script handles everything else.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: smoth's junk.

Post by smoth »

Image
(click for larger)

so now even this works with my scripts. yes most of those are vlaunch missiles. God that weapon type is ugly and cannot be customized to look different fuck vlaunch missiles!
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: smoth's junk.

Post by knorke »

do you want comments on the script or is not done yet?
Post Reply

Return to “Art & Modelling”