Starcraft: spring on mar-sara
Moderator: Moderators
Re: Starcraft: spring on mar-sara
They're scripts to perform animations, that are in lua instead of cob. That is why I call them lua animations. I really don't see whats wrong with calling them that. What incorrect inferred information are you referring to?
Re: Starcraft: spring on mar-sara
In fact its only his opinion because yes right i need lua coder not only for animations but for widgets and gadgets too.maackey wrote:They're scripts to perform animations, that are in lua instead of cob. That is why I call them lua animations. I really don't see whats wrong with calling them that. What incorrect inferred information are you referring to?
- Pressure Line
- Posts: 2283
- Joined: 21 May 2007, 02:09
Re: Starcraft: spring on mar-sara
smoke, you dont *need* lua to write unit scripts, you can still use the the bos/cob method, although tbh, they are not that different (in terms of writing a unit script)
Lua:
bos/cob
Except for the minor formatting differences, these scripts are identical.
The inference that Forb is referring to is that moving to lua scripts for unit animation allows for things that bos can't do. While there ARE some things to do with animation that you can do with Lua that you can't with bos, as well as easier integration with Lua gadgets but for 'My First Spring GameÔäó' it's probably not going to make a difference.
Lua:
Code: Select all
--pieces
local base = piece "base"
local turret = piece "turret"
local barrel = piece "barrel"
local flare = piece "flare"
--signals
local SIG_AIM = 2
function script.Create()
Hide(flare)
end
local function RestoreAfterDelay(unitID)
Sleep(2500)
Turn(turret, y_axis, 0, math.rad(90))
Turn(barrel, x_axis, 0, math.rad(50))
end
function script.QueryWeapon1() return flare end
function script.AimFromWeapon1() return turret end
function script.AimWeapon1( heading, pitch )
Signal(SIG_AIM)
SetSignalMask(SIG_AIM)
Turn(turret, y_axis, heading, math.rad(90))
Turn(barrel, x_axis, -pitch, math.rad(50))
WaitForTurn(turret, y_axis)
WaitForTurn(barrel, x_axis)
StartThread(RestoreAfterDelay)
return true
end
function script.FireWeapon1()
Sleep(30)
end
function script.Killed(recentDamage, maxHealth)
Sleep(30)
end
Code: Select all
#include "sfxtype.h"
#include "exptype.h"
piece base, turret, barrel, flare;
static-var restore_delay;
// Signal definitions
#define SIG_AIM 2
Create()
{
hide flare;
}
RestoreAfterDelay()
{
sleep 2500;
turn turret to y-axis <0.000000> speed <90>;
turn barrel to x-axis <0.000000> speed <50>;
}
QueryWeapon1(piecenum)
{
piecenum = flare;
}
AimFromWeapon1(piecenum)
{
piecenum = turret;
}
AimWepon1(heading, pitch)
{
signal SIG_AIM;
set-signal-mask SIG_AIM;
turn turret to y-axis heading speed <90>;
turn barrel to x-axis 0 - pitch speed <50>;
wait-for-turn turret around y-axis;
wait-for-turn barrel around x-axis;
start-script RestoreAfterDelay();
return (1);
}
FireWeapon1()
{
sleep 30;
}
Killed(severity, corpsetype)
{
sleep 30;
}
The inference that Forb is referring to is that moving to lua scripts for unit animation allows for things that bos can't do. While there ARE some things to do with animation that you can do with Lua that you can't with bos, as well as easier integration with Lua gadgets but for 'My First Spring GameÔäó' it's probably not going to make a difference.
Re: Starcraft: spring on mar-sara
Hmm....well that i calling good example. =) Thank you.
As i can see lua haves () syntax for data, but still cob using to write it right after call without (). Only question, I can put ready lua scripts in same folder like /<modname>/scripts/ where cob files are? So now i don't understand why authors of the game still using cob neither lua. It's need to be compiled..of course old TA animations on it. But still....how do you think, maybe easier make syntax converter, hm?
As i can see lua haves () syntax for data, but still cob using to write it right after call without (). Only question, I can put ready lua scripts in same folder like /<modname>/scripts/ where cob files are? So now i don't understand why authors of the game still using cob neither lua. It's need to be compiled..of course old TA animations on it. But still....how do you think, maybe easier make syntax converter, hm?
Re: Starcraft: spring on mar-sara
(the following is only my opinion on the subject)
COB is still supported because of (at least) those factors:
- many people know it;
- (probably more important) many games are using it and no one is going to convert all of those to lua scripts.
And it's good that way. lua scripting is more powerful and so is better for new projects.
COB is still supported because of (at least) those factors:
- many people know it;
- (probably more important) many games are using it and no one is going to convert all of those to lua scripts.
And it's good that way. lua scripting is more powerful and so is better for new projects.
Re: Starcraft: spring on mar-sara
If you already have a BOS script:
Keep it in BOS/COB until you need to convert
Otherwise if starting anew:
Use lua.
Always use the lua scripting for unit animations, but dont be religious about it and convert existing BOS animations that work fine. If its not broke, dont fix it
Keep it in BOS/COB until you need to convert
Otherwise if starting anew:
Use lua.
Always use the lua scripting for unit animations, but dont be religious about it and convert existing BOS animations that work fine. If its not broke, dont fix it