renderType | weapontype lookups?

renderType | weapontype lookups?

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
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

renderType | weapontype lookups?

Post 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.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: renderType | weapontype lookups?

Post 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
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: renderType | weapontype lookups?

Post by smoth »

well, I kinda want to get this corrected. I can try and use the code to update my files though! So thanks!
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: renderType | weapontype lookups?

Post 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.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: renderType | weapontype lookups?

Post 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?
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6240
Joined: 29 Apr 2005, 01:14

Re: renderType | weapontype lookups?

Post by FLOZi »

Which wiki page are you referring to? :?
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: renderType | weapontype lookups?

Post by Forboding Angel »

Make sure you're looking at the gamedev:weapondefs page on the wiki.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: renderType | weapontype lookups?

Post 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.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6240
Joined: 29 Apr 2005, 01:14

Re: renderType | weapontype lookups?

Post by FLOZi »

I ought to delete that pile of old shit. :roll:
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: renderType | weapontype lookups?

Post by smoth »

it is the only place I could find old tags to nuke
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: renderType | weapontype lookups?

Post by Forboding Angel »

FLOZi wrote:I ought to delete that pile of old shit. :roll:
Yes, you should. As in, asap.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: renderType | weapontype lookups?

Post 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.
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10450
Joined: 24 Jan 2006, 21:12

Re: renderType | weapontype lookups?

Post 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.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: renderType | weapontype lookups?

Post by smoth »

doesn't mean we should NOT try and do better
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10450
Joined: 24 Jan 2006, 21:12

Re: renderType | weapontype lookups?

Post 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.
Post Reply

Return to “Game Development”