Page 48 of 59

Re: Mod Question Repository... Questions come in, answers go out

Posted: 06 Feb 2010, 22:24
by Noruas
Need halp, hovers in xta used to turn their whole body relative to how much they are turning and recently since spring release they do barrel roles now, I don't know if its a spring bug but i could use help.

#include "sfxtype.h"
#include "exptype.h"

piece base, beam, nanogun, door1, door2, plate, post, wake1,
wake2, wake3, wake4, wake5, wake6, wake7, wake8, turret;

static-var Static_Var_1, Static_Var_2, statechg_DesiredState, statechg_StateChanging, Static_Var_5,
Static_Var_6, Static_Var_7;

// Signal definitions
#define SIG_MOVE 2


BankClerck(Func_Var_1, Func_Var_2, Func_Var_3)
{
while( TRUE )
{
Func_Var_1 = get PIECE_XZ(base);
Func_Var_3 = 0;
if( get XZ_HYPOT(Func_Var_1 - Func_Var_2) >= 163840 )
{
Func_Var_3 = 0 - get XZ_ATAN(Func_Var_2 - Func_Var_1) * 60 / 30;
}
turn base to z-axis Func_Var_3 speed <45.0>;
Func_Var_2 = Func_Var_1;
sleep 300;
}
return (0);
}

WobbleUnit()
{
while( get BUILD_PERCENT_LEFT )
{
sleep 400;
}
while( TRUE )
{
if( Static_Var_7 == 1 )
{
move base to y-axis [1.8] speed [1.0];
}
if( Static_Var_7 == 0 )
{
move base to y-axis [0.8] speed [1.0];
}
Static_Var_7 = !Static_Var_7;
sleep 750;
}
return (0);
}

Create()
{
Static_Var_5 = 1;
Static_Var_2 = 0;
start-script WobbleUnit();
start-script BankClerck();
return (0);
}
I could post the whole script if you want more information but what would you add to restrict the hovers banking to a certain degree to keep it from fully flipping over....

Re: Mod Question Repository... Questions come in, answers go out

Posted: 06 Feb 2010, 23:58
by SeanHeron
Hey - why the straight line smily Tobi ? One bug fixed, good job for KingRaptor to have indirectly reported it :). So well done!

Re: Mod Question Repository... Questions come in, answers go out

Posted: 07 Feb 2010, 00:41
by Tobi
That was from before I fixed it ;-)

Re: Mod Question Repository... Questions come in, answers go out

Posted: 07 Feb 2010, 07:20
by KingRaptor
Much thanks, Tobi!

Re: Mod Question Repository... Questions come in, answers go out

Posted: 09 Feb 2010, 20:58
by azaremoth
I have a probleme with map features not showing up in "The Cursed". I have noticed that County_Crossing-v06. It works with other games, thus something in the cursed seams to block the map features... :(

Re: Mod Question Repository... Questions come in, answers go out

Posted: 09 Feb 2010, 21:52
by KDR_11k
No missing feature error messages in the infolog?

Re: Mod Question Repository... Questions come in, answers go out

Posted: 09 Feb 2010, 22:37
by azaremoth
KDR_11k wrote:No missing feature error messages in the infolog?
Well - yes - sure. But why can't the features be loaded from the map archive when I start the cursed?

Re: Mod Question Repository... Questions come in, answers go out

Posted: 09 Feb 2010, 23:10
by Argh
Maybe the map is calling for Features that aren't physically present- no model meshes or textures.

Re: Mod Question Repository... Questions come in, answers go out

Posted: 10 Feb 2010, 10:12
by KDR_11k
azaremoth wrote:
KDR_11k wrote:No missing feature error messages in the infolog?
Well - yes - sure. But why can't the features be loaded from the map archive when I start the cursed?
Are they actually part of the map or does the map just try to load BA corpses or something?

Re: Mod Question Repository... Questions come in, answers go out

Posted: 10 Feb 2010, 19:08
by azaremoth
They are included in the map as far as I see... And I tried it with Evolution RTS - features work there - I can't imagine that this game has dependencies for BA.

Re: Mod Question Repository... Questions come in, answers go out

Posted: 10 Feb 2010, 20:44
by Master-Athmos
Can anyone give info on the way resurrection is handled:
What determines the time needed for the resurrection and what defines the amount of energy needed while doing so?

Re: Mod Question Repository... Questions come in, answers go out

Posted: 11 Feb 2010, 09:57
by SanadaUjiosan
I have a quick question. I'm screwing around with very simple Lua animations for some of my buildings, like mex's and power plants, and I want to know if there is a way to make an action repeat in an endless loop (that's not the Spin animation). What I'm wanting is for a part of my mex to move up and down in a slow-mo jackhammer type motion. I looked through what little the wiki had to say on Lua animation, and if it was in there, I didn't see it.

Re: Mod Question Repository... Questions come in, answers go out

Posted: 11 Feb 2010, 17:46
by FLOZi
SanadaUjiosan wrote:I have a quick question. I'm screwing around with very simple Lua animations for some of my buildings, like mex's and power plants, and I want to know if there is a way to make an action repeat in an endless loop (that's not the Spin animation). What I'm wanting is for a part of my mex to move up and down in a slow-mo jackhammer type motion. I looked through what little the wiki had to say on Lua animation, and if it was in there, I didn't see it.
DO A BARREL ROLL!

Or, more usefully, a while loop:

Code: Select all

local function Piston()
  while true do
    -- Move up command
    -- WaitForMove
    -- Move down
    -- WaitForMove
  end
end

function script.Create()
  StartThread(Piston)
end

Re: Mod Question Repository... Questions come in, answers go out

Posted: 12 Feb 2010, 00:16
by SanadaUjiosan
While that's totally doing what I'd like it to do, there's a problem.

For whatever reason, the animation quickly begins speeding up, and in a few seconds it's going so fast that my frames hit 1 and the program freezes up. I tested it again, lowering the gamespeed to 0.3, and watched it speed up. It escalates very quickly.

If this is important, I had to take out the --'s you included in the script. When I plugged my own info into what you posted (like the piece name, and the distance and speed and all that), Spring would crash when I tried building one. It'd be fine right up till the moment just before the mex was completed, and then the game would freeze and I had to force quit it.

Re: Mod Question Repository... Questions come in, answers go out

Posted: 12 Feb 2010, 18:09
by FLOZi
SanadaUjiosan wrote:While that's totally doing what I'd like it to do, there's a problem.

For whatever reason, the animation quickly begins speeding up, and in a few seconds it's going so fast that my frames hit 1 and the program freezes up. I tested it again, lowering the gamespeed to 0.3, and watched it speed up. It escalates very quickly.

If this is important, I had to take out the --'s you included in the script. When I plugged my own info into what you posted (like the piece name, and the distance and speed and all that), Spring would crash when I tried building one. It'd be fine right up till the moment just before the mex was completed, and then the game would freeze and I had to force quit it.
Sounds like you didn't fill in the WaitForMoves correctly, they are all that prevents it from freezing up.

Re: Mod Question Repository... Questions come in, answers go out

Posted: 13 Feb 2010, 00:17
by SanadaUjiosan
I checked and my WaitForMoves are correct, as far as I can tell. Here is what the whole script looks like, when it breaks and freezes the game.

Code: Select all

local building = piece "building"
local digger = piece "digger"


local function digger_animation()
  while true do
    Move (digger, y_axis, -20, 200)
    WaitForMove (digger, y_axis)
    Move (digger, y_axis, 0, 10)
    WaitForMove (digger, y_axis)
  end
end

function script.Create()
   StartThread(digger_animation)
end

function script.Killed(recentDamage, maxHealth)
   return 0
end

Re: Mod Question Repository... Questions come in, answers go out

Posted: 13 Feb 2010, 01:56
by FLOZi
I guess they aren't sufficient then, stick some Sleeps in too

Re: Mod Question Repository... Questions come in, answers go out

Posted: 13 Feb 2010, 03:44
by SanadaUjiosan
Sleeps fixed it. Thanks a lot.

Re: Mod Question Repository... Questions come in, answers go out

Posted: 13 Feb 2010, 14:47
by Tobi
Hmm another bug (instance gets added to UnitScriptEngine multiple times => it ticks more and more times per frame)

Thanks for implicitly reporting it :-)

Re: Mod Question Repository... Questions come in, answers go out

Posted: 14 Feb 2010, 04:27
by SanadaUjiosan
lol, awesome! I'm helping the engine!