Page 1 of 2

Games not loading models

Posted: 11 Oct 2013, 08:11
by The_Igishly_Co
Hello again,
Sorry to intrude again, but we've hit a snag here at TIG HQ... I have successfully turned my 3D model into a .s30 file. However, when i load the game (even the test game just to make sure it wasn't my coding) no game 3D models are loaded... I am wondering as to why this is. If you have any answers or assistance at all. We here at The Igishly Company would be greatly appreciative.
-Signed: The Igishly Company

Re: Games not loading models

Posted: 11 Oct 2013, 09:03
by gajop
It's usually helpful to post your infolog.txt.

Re: Games not loading models

Posted: 11 Oct 2013, 09:10
by Silentwings
Did you mean s3o ?

Maybe worth attaching your file as well...

Re: Games not loading models

Posted: 11 Oct 2013, 16:22
by knorke
If you load an unedited spring game, that works?
if not: http://springrts.com/wiki/Infolog.txt and a screenshot

If only your own 3d models fail to show, check this page:
http://springrts.com/wiki/Trouble-shoot ... sible_Unit

Re: Games not loading models

Posted: 11 Oct 2013, 21:14
by PicassoCT
Your model has to be mentioned in the unitdef

Also if the error persists.. post the model.. or at least a screenshot of how it is loaded in upspring?
http://springfiles.com/spring/tools/upspring

Do not despair, deving is hard and slow at the start. But becomes wonderfull if you stick to it.

Re: Games not loading models

Posted: 11 Oct 2013, 21:27
by FLOZi
Does the model have a texture2 applied in Upspring? if so be aware that alpha channel is 1-bit transparency.

Re: Games not loading models

Posted: 11 Oct 2013, 23:24
by The_Igishly_Co
Okay, when I say the game is not loading models, I meant that the game is not loading objects. And when I load a game that is supposed to have a basic tank model in game. There is in fact nothing there except the map... How do I get this fixed, my infotext file is in the original post.

Re: Games not loading models

Posted: 12 Oct 2013, 00:37
by FLOZi
Does

"/cheat"
followed by
"/give all"

Spawn any units?

Re: Games not loading models

Posted: 12 Oct 2013, 01:34
by knorke
[f=0000000] Using map: Mamap 1.8
[f=0000000] Using game: Empty Mod plus Tank
Those are not map/games where I would be 100% certain that they work.
Map I have never seen (is it yours?) and the game is some example-game but not 100% sure if it works, it is a bit old.

Try this game http://springfiles.com/spring/games/bal ... ilation-43 on this map http://springfiles.com/spring/spring-maps/smalldivide just to be sure that your spring install works.
[f=0000000] Error: Failed to load: precipitation.lua ([string "LuaGaia/Gadgets/precipitation.lua"]:54: Precipitation-Gadget: Can't find settings in mapinfo.lua!)
Broken map/gadget? Is that your map?

Re: Games not loading models

Posted: 12 Oct 2013, 02:35
by The_Igishly_Co
FLOZi wrote:Does

"/cheat"
followed by
"/give all"

Spawn any units?
Dear helpful chap in the front,
YES, thank you SO much... It spawned the unit and I am a happy happy little boy! Thank you once again! And is there any way that I ca make it so that it's there by default?

Re: Games not loading models

Posted: 12 Oct 2013, 02:53
by knorke
And is there any way that I ca make it so that it's there by default?
you need a lua script. in your game it is called "spawnplayer.lua" and in luarules\gadgets, but for some reason it does not work..

Re: Games not loading models

Posted: 12 Oct 2013, 03:52
by The_Igishly_Co
knorke wrote:
but for some reason it does not work..
Is there a working script out there that I can use?

Re: Games not loading models

Posted: 12 Oct 2013, 04:02
by The_Igishly_Co
knorke wrote:
And is there any way that I ca make it so that it's there by default?
you need a lua script. in your game it is called "spawnplayer.lua" and in luarules\gadgets, but for some reason it does not work..
And in the game is the spawn function called?

Re: Games not loading models

Posted: 12 Oct 2013, 05:02
by knorke
Was that the example download from http://springrts.com/wiki/The_Complete_ ... pring_Game ?
Those are a bit outdated, I will add warning to wiki.

Think problem is that the script tries to read team data of player but in testgames via spring.exe that is not set or something.
Basically what line 47 in this spawnscript does http://code.google.com/p/springtutorial ... awn.lua#47

Quick fix could be to delete this

Code: Select all

local _,_,_,ai,faction = Spring.GetTeamInfo(t)
local unitname = Spring.GetSideData(faction)
Spring.CreateUnit(unitname,sx,sy,sz,0,t)
and just specify the unit directly like this:
Spring.CreateUnit("tank",sx,sy,sz,0,t)
("tank" = put name of your unit)
(also remove the if unitname ... end)

Or just use this as a base, it should work: http://springrts.com/wiki/SpringTutorialGame

Re: Games not loading models

Posted: 12 Oct 2013, 05:23
by The_Igishly_Co
knorke wrote:Was that the example download from http://springrts.com/wiki/The_Complete_ ... pring_Game ?
Those are a bit outdated, I will add warning to wiki.

Think problem is that the script tries to read team data of player but in testgames via spring.exe that is not set or something.
Basically what line 47 in this spawnscript does http://code.google.com/p/springtutorial ... awn.lua#47

Quick fix could be to delete this

Code: Select all

local _,_,_,ai,faction = Spring.GetTeamInfo(t)
local unitname = Spring.GetSideData(faction)
Spring.CreateUnit(unitname,sx,sy,sz,0,t)
and just specify the unit directly like this:
Spring.CreateUnit("tank",sx,sy,sz,0,t)
("tank" = put name of your unit)
(also remove the if unitname ... end)

Or just use this as a base, it should work: http://springrts.com/wiki/SpringTutorialGame
You mind just posting a .png of a working script? Or a not as out dated one? (Yes, I used the outdated tutorial base)

Re: Games not loading models

Posted: 12 Oct 2013, 07:43
by smoth
why a .png? we can post scripts here just fine.you are aware all spring projects can be viewed? Any sdz/sd7 can be opened in seven zip. If you are using the rapid system go on spring files and you will find the sdz/sd7 files there if you need examples :)

Re: Games not loading models

Posted: 12 Oct 2013, 11:24
by FireStorm_

Code: Select all

function gadget:GetInfo()
  return {
    name      = "Super Simple Gadget to the rescue",
    desc      = "creates a neutral unit at centre of map",
    author    = "some person",
    date      = "2013",
    license   = "yes please",
    layer     = 8,
    enabled   = true
  }
end

if (not gadgetHandler:IsSyncedCode()) then
  return false
end

function gadget:GameStart()
	local gaiaID = Spring.GetPlayerTeamID()
	CreateUnit("builder1", (Game.mapSizeX/2), 0, Game.mapSizeX/2, "south", gaiaID)
	CreateUnit("tank1", (Game.mapSizeX/2)+100, 0, Game.mapSizeX/2, "south", gaiaID)
end
maybe this may help.
I think one can't have enough simple examples in the beginning.
I don't have any prior code experience before spring, so I still struggle with a lot of things that are probably obvious to others.

(note that this makes the units neutral, and un-commandable by player) I may have made a mistake but am a bit in a hurry :-)

side note:
(how could a calm period have killed a foundation stone like the Q&A... ?)

Re: Games not loading models

Posted: 12 Oct 2013, 11:55
by Forboding Angel
Why not just use game_spawn.lua??

https://code.google.com/p/evolutionrts/ ... _spawn.lua

^^ Spawns your initial unit and sets storage levels. Problem solved :-)

Re: Games not loading models

Posted: 13 Oct 2013, 13:50
by knorke
FireStorm_ :
local gaiaID = Spring.GetPlayerTeamID() Spring.GetGaiaTeamID
CreateUnit :arrow: Spring.CreateUnit

Btw the linked example spawn scripts are same as the one that is included with spring as an example in folder spring-94.1\base\springcontent.sdz\LuaGadgets\Gadgets\

Re: Games not loading models

Posted: 13 Oct 2013, 14:04
by FireStorm_
Thanks knorke
(and a general sorry)
Next time i'll try to remember to take the time needed to help properly :-)