base content files

base content files

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
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

base content files

Post by knorke »

forum eat my thread?
short version, why does this weapon: http://code.google.com/p/springtutorial ... ineGun.lua look like this:
Image
should be some plasma fireball, instead there are only some rectangles.
looks like missing textures.
I think I need to add some base textures or entries to resources.lua but dont know which ones.

modinfo.lua has springcontent.sdz:
http://code.google.com/p/springtutorial ... odinfo.lua

mod:
http://code.google.com/p/springtutorial ... alGame.sdd

There is probally more files missing then just the plasma bitmap...sound,..?
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6241
Joined: 29 Apr 2005, 01:14

Re: base content files

Post by FLOZi »

Use this resources.lua :

Code: Select all

local	resources = {
		graphics = {
			-- Spring Defaults
			groundfx = {
				groundflash	= 'groundflash.tga',
				groundring	= 'groundring.tga',
				seismic		= 'circles.tga',
			},
			projectiletextures = {
				circularthingy		= 'circularthingy.tga',
				laserend			= 'laserend.tga',
				laserfalloff		= 'laserfalloff.tga',
				randdots			= 'randdots.tga',
				smoketrail			= 'smoketrail.tga',
				wake				= 'wake.tga',
				flare				= 'flare.tga',
				explo				= 'explo.tga',
				explofade			= 'explofade.tga',
				heatcloud			= 'explo.tga',
				flame				= 'flame.tga',
				muzzleside			= 'muzzleside.tga',
				muzzlefront			= 'muzzlefront.tga',
				largebeam			= 'largelaserfalloff.tga',
			},
		}
	}

local VFSUtils = VFS.Include('gamedata/VFSUtils.lua')

local function AutoAdd(subDir, map, filter)
  local dirList = RecursiveFileSearch("bitmaps/" .. subDir)
  for _, fullPath in ipairs(dirList) do
    local path, key, ext = fullPath:match("bitmaps/(.*/(.*)%.(.*))")
    if not fullPath:match("/%.svn") then
    local subTable = resources["graphics"][subDir] or {}
    resources["graphics"][subDir] = subTable
      if not filter or filter == ext then
        if not map then
          table.insert(subTable, path)
        else -- a mapped subtable
          subTable[key] = path
        end
      end
    end
  end
end

-- Add mod projectiletextures
AutoAdd("projectiletextures", true)

return resources
Also note that the engine adds springcontent.sdz as first dependency, there is no need to put it in modinfo.lua.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: base content files

Post by knorke »

thanks, works. perfect.
Post Reply

Return to “Game Development”