models then what?
Moderator: Moderators
Re: models then what?
Success, I finally got my first unit to appear in game. I feel pretty good right now. So what's next? Movement?
Re: models then what?
Setting up a proper moveclass would indeed be a good start.
Examples of gamedata/movedefs.lua here:
CA
http://trac.caspring.org/browser/trunk/ ... vedefs.lua
S44
http://spring1944.svn.sourceforge.net/v ... iew=markup
Examples of gamedata/movedefs.lua here:
CA
http://trac.caspring.org/browser/trunk/ ... vedefs.lua
S44
http://spring1944.svn.sourceforge.net/v ... iew=markup
Re: models then what?
So put one of those in the lua file in the scripts folder?
Re: models then what?
No, gamedata folder, as I said.oksnoop2 wrote:So put one of those in the lua file in the scripts folder?
Re: models then what?
Sorry, I get rather anxious and don't read everything as closely as should sometimes. After pasting the one from CA into the movedef lua and starting up the mod. I still can't get my unit to move. Is there something aditional I have to do to tie my unit "static_saucer" to the movedef lua (hope that makes some kind of sense, i really don't know of a good way to phrase it)
Re: models then what?
Yes, movementclass tag i.e.
Worth looking at a full unitdef from CA, I suggest the jeffy:
http://trac.caspring.org/browser/trunk/ ... armfav.lua
Code: Select all
movementClass = [[TANK2]],
http://trac.caspring.org/browser/trunk/ ... armfav.lua
Re: models then what?
"Couldn't find unittype static_saucer" This is the message spring gives me. Here is the file i have in my units folder: http://pastebin.com/m61ef60c0
The file is named "static_saucer".
UPDATE: After tinkering with the unittype file i got it to work again. When I go in game my unit now has a "move" command. It still does not move. Is it because I did not "put object on ground" in wings3d? It is supposed to be a flying unit.
The file is named "static_saucer".
UPDATE: After tinkering with the unittype file i got it to work again. When I go in game my unit now has a "move" command. It still does not move. Is it because I did not "put object on ground" in wings3d? It is supposed to be a flying unit.
Re: models then what?
this thread makes it sound easy to make a mod
I might try myself

Re: models then what?
If you want it to fly, set these values:UPDATE: After tinkering with the unittype file i got it to work again. When I go in game my unit now has a "move" command. It still does not move. Is it because I did not "put object on ground" in wings3d? It is supposed to be a flying unit.
canMove=true,
canFly = true,
maxVelocity=5,
cruiseAlt = 500,
maxAcc = 0.5,
You do not need a movement class, for flying stuff; they have their own special class.
Re: models then what?
cool beans! My saucer, it fly's! So next step is, making it shoot perhaps? or is it something else?
Re: models then what?
you might want to try some animation scripting and shooting, yes.
Re: models then what?
Can some one direct me to a link on next step?
Re: models then what?
OK... animation.
Simplest way to learn: read the stuff in the Wiki... then study existing code. IDK what's currently best to read, in terms of good "newbie code". NanoBlobs was OK, but it would be teaching people to do a few things wrongly / inefficiently now, compared to P.U.R.E., and P.U.R.E.'s animation code is pretty complex and not terribly well commented. I honestly think we (the experienced animators) need to write some simpler, well-commented examples out to feed the Wiki with.
I will post some animation code here, but there is still no real guide for the basics that covers things very well (I've been thinking about writing one, this issue bothers me, because it's such a big newbie trap). There are various guides that cover parts here and there, but none of them end up being all that coherent (imo).
This assumes that you have three named Pieces (which may be nulls, if your model permits it): firepoint, turret, barrel.
Simplest way to learn: read the stuff in the Wiki... then study existing code. IDK what's currently best to read, in terms of good "newbie code". NanoBlobs was OK, but it would be teaching people to do a few things wrongly / inefficiently now, compared to P.U.R.E., and P.U.R.E.'s animation code is pretty complex and not terribly well commented. I honestly think we (the experienced animators) need to write some simpler, well-commented examples out to feed the Wiki with.
I will post some animation code here, but there is still no real guide for the basics that covers things very well (I've been thinking about writing one, this issue bothers me, because it's such a big newbie trap). There are various guides that cover parts here and there, but none of them end up being all that coherent (imo).
This assumes that you have three named Pieces (which may be nulls, if your model permits it): firepoint, turret, barrel.
Code: Select all
RestoreAfterDelay()
{
//wait approximately 5 seconds
sleep 5000;
//turn the barrel and the turret back to the home position
turn turret to y-axis <0> speed <100.0>;
turn barrel to x-axis <0> speed <100.0>;
return(0);
}
AimFromWeapon1 (piecenum)
{
//What piecenum do we use to check and see if we're aiming the right way?
piecenum = firepoint;
}
AimWeapon1(heading, pitch)
{
//Locks up that turret, so that nothing else can interfere with it until it's done
signal SIG_AIM1;
set-signal-mask SIG_AIM1;
//turn the turret towards the target
turn turret to y-axis heading speed <100.0>;
//we turn the barrel up / down while the turret turns around
turn barrel to x-axis 0 - pitch speed <100.0>;
//Wait for the turret to finish turning around
wait-for-turn turret around y-axis;
//Wait for that barrel to aim upwards / downwards
wait-for-turn barrel around x-axis;
//If we're ready to fire, start the timer on recovery.
start-script RestoreAfterDelay();
//FIRE!
return(TRUE);
}
QueryWeapon1(piecenum)
{
//Where is our shot coming from?
piecenum = firepoint;
return(0);
}
Shot1()
{
//do cool FX or whatever here
}
FireWeapon1()
{
//you can also do cool FX or whatever here, but I prefer Shot()
}
Re: models then what?
N.B. as Argh neglected to mention, that is BOS animation code
Re: models then what?
thanks for telling me it was BOS
Re: models then what?
..are there any lua examples?
Re: models then what?
you might need to post in the Lua forum
Re: models then what?
I don't have any Lua examples written yet. Was kinda thinking FLOZi would, they (the S'44 team) has been in the forefront of using this new technology, I haven't had time to catch up yet.
Re: models then what?
What directory of the mod would this animation code go in? And is it the same place for both lua and cob?
Re: models then what?
Both Lua and COB go into the scripts directory.