models then what? - Page 4

models then what?

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

User avatar
SpliFF
Posts: 1224
Joined: 28 Jul 2008, 06:51

Re: models then what?

Post by SpliFF »

Code: Select all

Could not load COB script from: scripts/hovertank.cob
in your unit def you need to load the script 'hovertank.lua', not simply 'hovertank'. It's looking for a COB script, not a lua script.
User avatar
oksnoop2
Posts: 1207
Joined: 29 Aug 2009, 20:12

Re: models then what?

Post by oksnoop2 »

I'm pretty sure the file that rests in the scripts folder is a lua file. When I look at it reads: hovertank
LUA file

screenshot
http://img199.imageshack.us/img199/9942 ... aproof.png
User avatar
SpliFF
Posts: 1224
Joined: 28 Jul 2008, 06:51

Re: models then what?

Post by SpliFF »

Yes, what I mean is in your units/hovertank.lua there may be a line like:

script = "hovertank"

change to or add the line:

script = "hovertank.lua"

otherwise the engine just appends '.cob' to 'hovertank' and tries to load that. You don't have (or need) a COBfile, you need it to load your lua file which means you need to be more explicit with the path.
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Re: models then what?

Post by Tobi »

oksnoop2 wrote:Is there a file in these folders that is undermining what i'm trying to do?
Entire LuaRules is broken... -> Lua unit animations won't work either.
[ 0] Loading LuaRules
[ 0] Lua LoadCode pcall error = 2, LuaRules/main.lua, error = 2, LuaRules/gadgets.lua, error = 2, LuaRules/factions.lua, [string "LuaRules/factions.lua"]:24: attempt to index local 'ud' (a nil value)
User avatar
SpliFF
Posts: 1224
Joined: 28 Jul 2008, 06:51

Re: models then what?

Post by SpliFF »

Your problems are the result of piecing together things from different places. I have a mod up on my webspace which is much simpler than the S44 and CA mods and still uses most of the new lua data files established as COB and FBI are being phased out.

http://warriorhut.org/spring/mods/

DummyMod is about as simple as it is possible to get. Metalstorm (under the testing subdirectory) is in early development. Both are useful starting points or references for your own mod. Metalstorm still uses COB for animation though so be aware you still want to point to your lua animation script when you do your own units.
User avatar
Pressure Line
Posts: 2283
Joined: 21 May 2007, 02:09

Re: models then what?

Post by Pressure Line »

Tobi wrote:
oksnoop2 wrote:Is there a file in these folders that is undermining what i'm trying to do?
Entire LuaRules is broken... -> Lua unit animations won't work either.
[ 0] Loading LuaRules
[ 0] Lua LoadCode pcall error = 2, LuaRules/main.lua, error = 2, LuaRules/gadgets.lua, error = 2, LuaRules/factions.lua, [string "LuaRules/factions.lua"]:24: attempt to index local 'ud' (a nil value)
indeed. thats CA's gadgets.lua breaking, just comment out (with a --) or delete the:

Code: Select all

VFS.Include(SCRIPT_DIR .. 'factions.lua', nil, VFSMODE)
line. should fix that particular problem.
User avatar
oksnoop2
Posts: 1207
Joined: 29 Aug 2009, 20:12

Re: models then what?

Post by oksnoop2 »

I tried pressure line's latest suggestion of deleting that line. It didn't seem to do anything. If anyone wanted to look at the state of my mod here it is: http://www.megaupload.com/?d=VCCUDADW

Just unzip it. At the very least you can get a chuckle at my ugly tank.
User avatar
Pressure Line
Posts: 2283
Joined: 21 May 2007, 02:09

Re: models then what?

Post by Pressure Line »

1) your model is backwards.
2) you havent put a line in the /units/hovertank.lua that reads: script = [[hovertank.lua]],
3) wth is "Spring.DestroyUnit( unitID, 0 )" doing in your FireWeapon1 function?
4) remove EVERYTHING in your /luarules/gadgets/ folder EXCEPT for the unit_scripts.lua file

...Actually, just use the attached mod. I've rotated your model, made is 3x3, added the script line to the unit.lua, fixed the script.lua and unlocked LuaUI.

*edit* oops. forgot something on the model, re-uploaded.
Attachments
A.zip
(687.77 KiB) Downloaded 17 times
User avatar
Pressure Line
Posts: 2283
Joined: 21 May 2007, 02:09

Re: models then what?

Post by Pressure Line »

Image

Proof that I got it working.
User avatar
oksnoop2
Posts: 1207
Joined: 29 Aug 2009, 20:12

Post by oksnoop2 »

Oh man, Oh man! thank you so much. I've already watched my little hover tank kill the null AI's hovertank about 4 times and i am filled with joy every time. I'm am genuinely and wholeheartedly thankful for what you have done. Oh and to answer your 1-4

1. I'm a dunce
2.I could not get the syntax right on the script = hovertank.lua thing and it kept breaking my mod so i took it out.. so in short...i'm a dunce
3.I have no idea what the spring.destroyunit thing is and i saw it somewhere in a lua example so i jammed it in there. ~ dunce
4.I tried that once it didn't change a thing (probably because of #2) so put all the crap back in. So i'm not calling dunce on that one but i will say poor reasoning skills came into play.

Anyway thanks to the max. Now....what's next?
User avatar
Pressure Line
Posts: 2283
Joined: 21 May 2007, 02:09

Re: models then what?

Post by Pressure Line »

make moar? 8)

and remember:
+ve Z axis is the front of the unit.
I don't know if blender uses the same units as upspring/spring (wings does), but a 16x16 model is 1x1 footprint, 32x32 = 2x2 etc etc
you can achive a smooth look without having to use 16 sided cylinders (8 is enough really).
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Re: models then what?

Post by rattle »

4-5 with smooth shading... seriously. Especially small stuff like these barrels
I don't know if blender uses the same units as upspring/spring (wings does), but a 16x16 model is 1x1 footprint, 32x32 = 2x2 etc etc
I think both wings and blender have an option for the exporter to upscale the model upon exporting. 1 spring unit (as in elmo) are 8 units in your model app
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Re: models then what?

Post by FLOZi »

Fwiw, S44 barrels are mostly 6-sided
User avatar
oksnoop2
Posts: 1207
Joined: 29 Aug 2009, 20:12

Re: models then what?

Post by oksnoop2 »

3 things. I don't understand the units of measure and footprints you are talking about. I made "moar" My poor robot is not walking though just kind of contorts his legs and then scoots across the map. Also my text on the texture is backwards. Here are the links to relevant stuff.

http://img525.imageshack.us/gal.php?g=huncback.png Just a screen shot of my unit in wings. When it's in wings the text is correct. When it gets into spring the text is backwards.

http://pastebin.com/m24a5320c That's my script. I know i made no use of the leftknee/rightknee thing. I just don't know what to do with them.

http://pastebin.com/m1c713565 This is my unit.

I basically just looked at my hovertank script and unit lua and then at a lua script i found in CA for the "M-6" http://trac.caspring.org/browser/trunk/ ... ts/m-6.lua

http://pastebin.com/m26dc0d17 Infolog


If anyone one needs to look at anything else i'll happily share. Thank you in advance for any potential help. It seems that this attempt went much more smoothly than with the hovertank. The texture looks nicer and albeit the bot does not move correctly. It did not take umpteen attempts to make appear in game. So i'm happy with my learning curve.
User avatar
Pressure Line
Posts: 2283
Joined: 21 May 2007, 02:09

Re: models then what?

Post by Pressure Line »

upspring has a different x-axis to wings. flip the model on the x-axis (so the text is bacwards in wings) and re-export.

the reason the m-6 script looks downright weird is because the m-6 has reversed knees and is posed differently (also, according to maackey, the guy who made the model, the script is a bit broken) so the script will not really work for your model.

pic of the m-6:
Image
User avatar
maackey
Posts: 490
Joined: 02 Jul 2008, 07:11

Re: models then what?

Post by maackey »

gah! that unit script is so broken, please don't use that as a base for working on new stuff.

Lua anims do work; its what i'm using for ca and my own personal project. (its just that some scripts aren't finished -- like the m-6) I recently have had very very little time to work on anything due to some irl stuff, but if you have any specific questions i'd be happy to help answer them.
User avatar
oksnoop2
Posts: 1207
Joined: 29 Aug 2009, 20:12

Re: models then what?

Post by oksnoop2 »

I do plan in the future to write my own lua animations from scratch, but i'm just not there, knowledge wise, yet. I need examples of working lua scripts. So if anyone has any good scripts or knows of any i would be very happy if someone would share.

PS: I think the M-6 looks pretty cool.
User avatar
maackey
Posts: 490
Joined: 02 Jul 2008, 07:11

Re: models then what?

Post by maackey »

the roach script in ca is quite passable. Ideally I could remove some commented code that is useless, and add/clarify some comments especially for newbies, but its pretty straightforward (heh, well ofc it does to me, I wrote it :wink: )

Image this is what it looks like just in case. (well, neddie put a prettier texture on it, but you get the drift)
User avatar
Pressure Line
Posts: 2283
Joined: 21 May 2007, 02:09

Re: models then what?

Post by Pressure Line »

or just use one of the hundreds of .bos scripts and convert to .lua... still easier than doing it from nothing.
User avatar
oksnoop2
Posts: 1207
Joined: 29 Aug 2009, 20:12

Re: models then what?

Post by oksnoop2 »

On the roach there does not seem to have any xyz values so how does it know how to move the legs? On pressureline's suggestion, is there some kind of conversion tool or method?
Post Reply

Return to “Game Development”