Mod Question Repository... Questions come in, answers go out
Moderator: Moderators
Re: Mod Question Repository... Questions come in, answers go out
as time passes, spring treats errors in mods more strictly. so i guess you just have some errors in the mod that got ignored in the past.. try to fix them. (invalid wreck info seems to be a good hint, for example).
Re: Mod Question Repository... Questions come in, answers go out
Tend to be the hardest to debug as that message is usually nonsense. Any other errors in the infolog?Couldnt find wreckage info dgjeagfab
Re: Mod Question Repository... Questions come in, answers go out
It really isn't.hoijui wrote:(invalid wreck info seems to be a good hint, for example).

- CarRepairer
- Cursed Zero-K Developer
- Posts: 3359
- Joined: 07 Nov 2007, 21:48
Re: Mod Question Repository... Questions come in, answers go out
This error is often when the unitdef didn't load properly in the first place, due to syntax errors usually.FLOZi wrote:It really isn't.hoijui wrote:(invalid wreck info seems to be a good hint, for example).I've not looked at the code recently so it may have changed, but I've gotten that error many times before for varied reasons; none of them ever to do with the units corpse.
Re: Mod Question Repository... Questions come in, answers go out
thanks for the input :)
I went through the .fbi files and found the cause. Seems that the new version of spring doesn┬┤t like labs without the YardMap tag nowadays.
After adding that all worked as usual.
I went through the .fbi files and found the cause. Seems that the new version of spring doesn┬┤t like labs without the YardMap tag nowadays.
After adding that all worked as usual.
- tyran_nick
- Posts: 47
- Joined: 07 Mar 2010, 12:42
Re: Mod Question Repository... Questions come in, answers go out
Two questions:
1st: Is there a way to make a unit immobile on creation for a given ammount of time? I have a unit that after it is build it has a deployment animation. Can I force it using cob not to move until the script is finished?
2nd: I m having trouble making the same unit leave track marks. I copied and pasted the fbi part about the tracks from a unit that works (4-5 lines). Then I tried different numbers for TrackOffset but I can't get it to work. Is there anything else I am missing? It may be help telling you that the unit has an extreme footpring of 8 by 16.
1st: Is there a way to make a unit immobile on creation for a given ammount of time? I have a unit that after it is build it has a deployment animation. Can I force it using cob not to move until the script is finished?
2nd: I m having trouble making the same unit leave track marks. I copied and pasted the fbi part about the tracks from a unit that works (4-5 lines). Then I tried different numbers for TrackOffset but I can't get it to work. Is there anything else I am missing? It may be help telling you that the unit has an extreme footpring of 8 by 16.
Re: Mod Question Repository... Questions come in, answers go out
1)
2) Make all kind of hybrids between the unit that work and the unit that doesn't until you find which trait cause tracks to work or not.
There always is! Not even one, but several!Is there a way
force it using cob not to move
Code: Select all
// Ideally, MAX_SPEED should be defined in a .h
// These three lines make sure it is defined, whether already in a .h or not.
#ifndef MAX_SPEED
#define MAX_SPEED 75
#endif
static-var remember_max_speed;
Create()
{
remember_max_speed=get MAX_SPEED;
....
while(get BUILD_PERCENT_LEFT)//while under construction
{
....// some build animation maybe?
sleep ....; // But have at least a sleep, or else Spring will freeze
}
set MAX_SPEED to 1;// For some reason, setting it to 0 doesn't (or didn't?) work. 1 is small enough you won't see it moving.
...
// Your undeploy anim
...
set MAX_SPEED to remember_max_speed;// Let it move again
}
2) Make all kind of hybrids between the unit that work and the unit that doesn't until you find which trait cause tracks to work or not.
- tyran_nick
- Posts: 47
- Joined: 07 Mar 2010, 12:42
Re: Mod Question Repository... Questions come in, answers go out
Thanks for the really fast reply!!
It compiles without any problems but it doesn't stop the unit from moving. I ve pasted the create() part
It compiles without any problems but it doesn't stop the unit from moving. I ve pasted the create() part
Code: Select all
Create()
{
remember_max_speed=get MAX_SPEED;
move leg1 to x-axis [13.5] now;
move leg2 to x-axis [-13.5] now;
move art_door1 to x-axis [7.5] now;
move art_door2 to x-axis [-7.5] now;
move feet1 to y-axis [-3.5] now;
move feet2 to y-axis [-3.5] now;
move artbase to y-axis [12.5] now;
move art_b11 to z-axis [7.5] now;
move art_b21 to z-axis [7.5] now;
move art_b31 to z-axis [7.5] now;
move art_b12 to z-axis [20] now;
move art_b22 to z-axis [20] now;
move art_b32 to z-axis [20] now;
turn arttur to x-axis <-15> now;
move artside1 to x-axis [5] now;
move artside2 to x-axis [-5] now;
while(get BUILD_PERCENT_LEFT)
{
sleep 200;
}
Static_Var_1 = 1;
Static_Var_2 = 1;
start-script Stop_tur2();
start-script Stop_tur1();
spin radar around y-axis speed <-30.000000>;
dont-shade tur1_doorb;
dont-shade tur1_doorf;
dont-shade tur2_doorb;
dont-shade tur2_doorf;
start-script SmokeUnit();
call-script InitState();
set MAX_SPEED to 1;// For some reason, setting it to 0 doesn't (or didn't?) work. 1 is small enough you won't see it moving.
move feet1 to y-axis [0] speed [10];
move feet2 to y-axis [0] speed [10];
turn arttur to x-axis <0> speed <60>;
turn artrot to y-axis <0> speed <60>;
wait-for-turn arttur around y-axis;
wait-for-turn arttur around x-axis;
move artside1 to x-axis [0] speed [10];
move artside2 to x-axis [0] speed [10];
move art_b11 to z-axis [0] speed [10];
move art_b21 to z-axis [0] speed [10];
move art_b31 to z-axis [0] speed [10];
move art_b12 to z-axis [0] speed [10];
move art_b22 to z-axis [0] speed [10];
move art_b32 to z-axis [0] speed [10];
wait-for-move art_b32 along z-axis;
move artbase to y-axis [0] speed [10];
wait-for-move artbase along y-axis;
move art_door1 to x-axis [0] speed [10];
move art_door2 to x-axis [0] speed [10];
move leg1 to x-axis [0] speed [10];
move leg2 to x-axis [0] speed [10];
wait-for-move feet2 along y-axis;
wait-for-move art_door1 along x-axis;
wait-for-move leg1 along z-axis;
set MAX_SPEED to remember_max_speed;// Let it move again
set ARMORED to 1;
}
- tyran_nick
- Posts: 47
- Joined: 07 Mar 2010, 12:42
Re: Mod Question Repository... Questions come in, answers go out
Apparently for the tracks I was missing a rather important line...
Having that sorted I got a new problem/question. Is there a way to overlay two different track marks? I have made a unit that has 4 tracks that are not in exact alignment (see pics).

Notice that the front and back tracks are not aligned.

Works fine for the back tracks, but not for the front ones.
and this is the track file i used:

Though not apparent from the pic the mark looks ok for both tracks behind the unit, but I haven't found how to make it start nicely for the front tracks.

Code: Select all
leaveTracks=1;

Notice that the front and back tracks are not aligned.

Works fine for the back tracks, but not for the front ones.
and this is the track file i used:

Though not apparent from the pic the mark looks ok for both tracks behind the unit, but I haven't found how to make it start nicely for the front tracks.
I ll rephrase, what is the way to make the front tracks leave a mark correctly?There always is!Is there a way

- bobthedinosaur
- Blood & Steel Developer
- Posts: 2702
- Joined: 25 Aug 2004, 13:31
Re: Mod Question Repository... Questions come in, answers go out
you need to stretch the tracks along the z axis rrr move them forward. I forgot which particular tag it was but i think it is documented in the wiki.
- tyran_nick
- Posts: 47
- Joined: 07 Mar 2010, 12:42
Re: Mod Question Repository... Questions come in, answers go out
Is there any way to change the turn rate or the turninplace of a unit using cob? I want to make a unit with MAX_SPEED = 1 unable to turn as well.
- bobthedinosaur
- Blood & Steel Developer
- Posts: 2702
- Joined: 25 Aug 2004, 13:31
Re: Mod Question Repository... Questions come in, answers go out
You can't do that in cob alone. Sorry, I've tried. you will either have to make a gadget or do the script in lus, by making it immobile.
I didnt know you could set heading. good job yuri
I didnt know you could set heading. good job yuri
Last edited by bobthedinosaur on 13 Sep 2010, 04:27, edited 1 time in total.
Re: Mod Question Repository... Questions come in, answers go out
You CAN do it in cob. Not change the turn rate, but make a unit unable to turn. Like so:
This will effectively lock a unit to one direction (100 can be reduced down to 30 = 1 frame if the result doesn't look good).
Code: Select all
oldHeading = get HEADING;
while(cannot_turn)
{
set HEADING to oldHeading;
sleep 100;
}
- tyran_nick
- Posts: 47
- Joined: 07 Mar 2010, 12:42
Re: Mod Question Repository... Questions come in, answers go out
That worked perfectly! At sleep 100 it was doing a spastic move, but at sleep 30 it was completely still.
EDIT: Next question, is there a way to add a second button apart from activate using cob? I need activation for getting lups work ok with airjets of a flying unit and a button to make the unit deploy. Currently I m using the replace unit lua and two different units + cob scripts, but I guess it should be possible to do it with a nice script. If I have to replace my cob with lua can you provide any example units I should have a look at?
EDIT: Next question, is there a way to add a second button apart from activate using cob? I need activation for getting lups work ok with airjets of a flying unit and a button to make the unit deploy. Currently I m using the replace unit lua and two different units + cob scripts, but I guess it should be possible to do it with a nice script. If I have to replace my cob with lua can you provide any example units I should have a look at?
- bobthedinosaur
- Blood & Steel Developer
- Posts: 2702
- Joined: 25 Aug 2004, 13:31
Re: Mod Question Repository... Questions come in, answers go out
well I'll be damned. I didn't know you could Set heading. GJ yuri
- bobthedinosaur
- Blood & Steel Developer
- Posts: 2702
- Joined: 25 Aug 2004, 13:31
Re: Mod Question Repository... Questions come in, answers go out
Question for cob transports. if there a way to choose which unit is being unloaded? it seems like the 1st unit loaded is the first one off which doesnt help if he needs to be the last one off. maybe i could re attach other parts to take their place? this is all done on external attach points.
- FireStorm_
- Posts: 666
- Joined: 19 Aug 2009, 16:09
Re: Mod Question Repository... Questions come in, answers go out
[ 0] LuaRules::RunCallIn: error = 2, GameStart, [string "LuaRules/Gadgets/game_start.lua"]:68: CreateUnit(): bad unitDef name: leo
The problem is probably outside my current skill-spectrum, but I thought I'd ask just in case:
Does anyone know what bad unitDef name: means?
I thought leo is fine name for any unit to have. :)
Forum search did not help.
Can InternalName and UnitName conflict if they are the same? might it be Lua related? point is, I don't know, and hope some can point in the right direction.
The problem is probably outside my current skill-spectrum, but I thought I'd ask just in case:
Does anyone know what bad unitDef name: means?
I thought leo is fine name for any unit to have. :)
Forum search did not help.
Can InternalName and UnitName conflict if they are the same? might it be Lua related? point is, I don't know, and hope some can point in the right direction.
-
- Posts: 834
- Joined: 19 May 2009, 21:10
Re: Mod Question Repository... Questions come in, answers go out
That it's bad/invalid.FireStorm_ wrote:[ 0] LuaRules::RunCallIn: error = 2, GameStart, [string "LuaRules/Gadgets/game_start.lua"]:68: CreateUnit(): bad unitDef name: leo
The problem is probably outside my current skill-spectrum, but I thought I'd ask just in case:
Does anyone know what bad unitDef name: means?
Only if mod maker agrees. unitDef name or unitDef id are used to specify the type of unit you want to create. They are not freely chosen tags. Those names are defined by the mod. E.g. in BA for stumpy you have to use "armstump" or the equivalent unitdef id.I thought leo is fine name for any unit to have. :)
If your mod has a unit named "leo", then look in infolog for other related errors. For example with syntax erros in unit definition files or missing model or textures files the unit won't be loaded and not be available in game.
- bobthedinosaur
- Blood & Steel Developer
- Posts: 2702
- Joined: 25 Aug 2004, 13:31
Re: Mod Question Repository... Questions come in, answers go out
is there a way to make larger units effectively push smaller units out of the way when moving at higher speeds, without stopping the larger units or slowing them down drastically as they push. or are we stuck with this? is this the extent of the push system?
ie: 3x4 unit with a mass of 30000 runs into a 1x1 of 100 at full speed, pushes it out of the way, but has to come to a dead stop
ie: 3x4 unit with a mass of 30000 runs into a 1x1 of 100 at full speed, pushes it out of the way, but has to come to a dead stop
Re: Mod Question Repository... Questions come in, answers go out
I wrote a toggle gadget that lets you define arbitrary toggle keys for your COB but I don't remember where I used it other than THIS (the mod itself is probably broken now but the script should work).tyran_nick wrote:That worked perfectly! At sleep 100 it was doing a spastic move, but at sleep 30 it was completely still.
EDIT: Next question, is there a way to add a second button apart from activate using cob? I need activation for getting lups work ok with airjets of a flying unit and a button to make the unit deploy. Currently I m using the replace unit lua and two different units + cob scripts, but I guess it should be possible to do it with a nice script. If I have to replace my cob with lua can you provide any example units I should have a look at?