Page 1 of 1

renderType | weapontype lookups?

Posted: 24 Oct 2016, 01:39
by smoth
I have a bunch of old defs that I need to update. Odds are it is a quick find and replace but I cannot find a reference to what is what.
the wiki wrote:Rendertype depreciated
Used for auto detection of ota weapontypes.

Re: renderType | weapontype lookups?

Posted: 24 Oct 2016, 03:35
by Forboding Angel
Throw this in weapondefs_post

Code: Select all

local function BackwardCompability(wdName,wd)
	-- auto detect ota weapontypes
	if (wd.weapontype==nil) then
		local rendertype = tonumber(wd.rendertype) or 0
		if (tobool(wd.dropped)) then
			wd.weapontype = "AircraftBomb";
		elseif (tobool(wd.vlaunch)) then
			wd.weapontype = "StarburstLauncher";
		elseif (tobool(wd.beamlaser)) then
			wd.weapontype = "BeamLaser";
		elseif (tobool(wd.isshield)) then
			wd.weapontype = "Shield";
		elseif (tobool(wd.waterweapon)) then
			wd.weapontype = "TorpedoLauncher";
		elseif (wdName:lower():find("disintegrator",1,true)) then
			wd.weaponType = "DGun"
		elseif (tobool(wd.lineofsight)) then
			if (rendertype==7) then
				wd.weapontype = "LightningCannon";

			elseif (wd.model and wd.model:lower():find("laser",1,true)) then
				wd.weapontype = "LaserCannon";

			elseif (tobool(wd.beamweapon)) then
				wd.weapontype = "LaserCannon";
			elseif (tobool(wd.smoketrail)) then
				wd.weapontype = "MissileLauncher";
			elseif (rendertype==4 and tonumber(wd.color)==2) then
				wd.weapontype = "EmgCannon";
			elseif (rendertype==5) then
				wd.weapontype = "Flame";
			--elseif(rendertype==1) then
			--  wd.weapontype = "MissileLauncher";
			else
				wd.weapontype = "Cannon";
			end
		else
			wd.weapontype = "Cannon";
		end
	end
end

local function ProcessWeaponDef(wdName, wd)
	-- backward compability
	BackwardCompability(wdName,wd)
end

for wdName, wd in pairs(WeaponDefs) do
	if (isstring(wdName) and istable(wd)) then
		ProcessWeaponDef(wdName, wd)
	end
end

Re: renderType | weapontype lookups?

Posted: 24 Oct 2016, 04:34
by smoth
well, I kinda want to get this corrected. I can try and use the code to update my files though! So thanks!

Re: renderType | weapontype lookups?

Posted: 24 Oct 2016, 04:44
by Forboding Angel
You can use something like dngrep (https://github.com/dnGrep/dnGrep/releases) to grep for the rendertypes and replace them with weaponType = blah. Probably the least painful way to go about it.

Re: renderType | weapontype lookups?

Posted: 24 Oct 2016, 04:55
by smoth
a few others are coming up:
  • lineofsight
  • selfprop
  • shakeduration
  • shakemagnitude
  • color
  • dropped
  • beamweapon
  • beamlaser
  • ballistic
  • guidance???
  • smokedelay
going by dropped, guidance, lineofsight, selfprop, we have new weapon classes?

"search the wiki," funny, the wiki search is not pulling results for all of these. IMO this thread has a reason to live so that OTHERS who run into this can get answers. Inbefore a certain troll posts in this thread.
Guidance depreciated
(does nothing)

Should this be "use tracks tag instead? or something similar?

*edits*
hmm, seems like we had guidance and tracks? dunno.

Why is it:
the wiki wrote:Tracks If the missile tracks a moving target. Can be set to 1 or 0. tracks=1;
Why not "true" or "false" like the rest of the tags?

"shakeduration"
"shakemagnitude"
// lol taisms in my old defs

"smokedelay"
"startsmoke"
// these were useful, why are they gone now?

Re: renderType | weapontype lookups?

Posted: 24 Oct 2016, 09:44
by FLOZi
Which wiki page are you referring to? :?

Re: renderType | weapontype lookups?

Posted: 24 Oct 2016, 17:42
by Forboding Angel
Make sure you're looking at the gamedev:weapondefs page on the wiki.

Re: renderType | weapontype lookups?

Posted: 24 Oct 2016, 20:46
by smoth
FLOZi wrote:Which wiki page are you referring to? :?
https://springrts.com/wiki/Weapon_Variables

I would make the changes myself but I am not sure if they are a good idea, so I want to ask before I go and edit stuff.

Re: renderType | weapontype lookups?

Posted: 24 Oct 2016, 23:00
by FLOZi
I ought to delete that pile of old shit. :roll:

Re: renderType | weapontype lookups?

Posted: 24 Oct 2016, 23:35
by smoth
it is the only place I could find old tags to nuke

Re: renderType | weapontype lookups?

Posted: 25 Oct 2016, 04:06
by Forboding Angel
FLOZi wrote:I ought to delete that pile of old shit. :roll:
Yes, you should. As in, asap.

Re: renderType | weapontype lookups?

Posted: 26 Oct 2016, 00:21
by smoth
spring should no longer say it runs ota content. This puts many of the *A projects further into "derivative content" based on items take from the Ta .hpi.

Re: renderType | weapontype lookups?

Posted: 26 Oct 2016, 20:03
by PicassoCT
Sorry, smoth, but unlike anime or movie franchises and active game franchises. Game IP can die and be burried. Not even archology can undig TA by now.

Re: renderType | weapontype lookups?

Posted: 27 Oct 2016, 17:25
by smoth
doesn't mean we should NOT try and do better

Re: renderType | weapontype lookups?

Posted: 27 Oct 2016, 17:56
by PicassoCT
But we dont want to do better.

The suggested per Piece auto-Texturing, a newb tool nobody was interested in.
We supply good enough tools to those who where lucky enough to get into spring, when it was still amateurish and easy to get into.
A newb joining today is shit out of look.
And you and me we are part of the problem, walling them with endless tutorials, where all they want is instant success noodles.
Back before ssmf, the mapconverter, with bitmaps.. that was easy access.

And nobody lifts a finger for the allmende. Because, thats not directly measurable a benefit for my game.

Wanting something is worthless, if no effort goes towards it.