Mod Question Repository... Questions come in, answers go out - Page 52

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

Resources to get you going on your new project, or to help you over some emergent problems during your development cycle.

Moderator: Moderators

Locked
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

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

Post by Tobi »

bobthedinosaur wrote:Is there a way to limit a repair rate that a 'construction unit' can repair certain units and some not repairing at all?
Not repairing at all: repairable tag

Different repair rate for different types of units will have to be Lua'ed.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

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

Post by KDR_11k »

If you mean different rates from the same constructor on different targets that needs Lua (though it's tied to the TA build time so if you use a custom resource system you can adjust the buildtime without affecting anything outside of repairs). If you just want a constructor to generally repair at a different rate than build there's the repair rate tag. There's also a tag that limits the combined repair speed a bunch of cons can have.
raaar
Metal Factions Developer
Posts: 1095
Joined: 20 Feb 2010, 12:17

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

Post by raaar »

What's the simplest way to prevent transports from loading enemy units?
User avatar
Noruas
XTA Developer
Posts: 1269
Joined: 24 Feb 2005, 02:58

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

Post by Noruas »

Do burnblow torpedos work or not? I am having some problems with making it burnblow.
raaar
Metal Factions Developer
Posts: 1095
Joined: 20 Feb 2010, 12:17

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

Post by raaar »

http://springrts.com/wiki/Weapon_Variables

BurnBlow

The weapon blows up when it reaches the range the target was at when the weapon fired. Only works on plasma (WeaponType=Cannon) weapons and should now work on Missiles. Can be 1 or 0. A common usage is on flak guns.

maybe it still only works on ballistic weapons?
User avatar
bobthedinosaur
Blood & Steel Developer
Posts: 2702
Joined: 25 Aug 2004, 13:31

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

Post by bobthedinosaur »

test it out and get back to us
User avatar
Noruas
XTA Developer
Posts: 1269
Joined: 24 Feb 2005, 02:58

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

Post by Noruas »

It appears not to work.
User avatar
bobthedinosaur
Blood & Steel Developer
Posts: 2702
Joined: 25 Aug 2004, 13:31

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

Post by bobthedinosaur »

Okay. I know I am doing a couple things wrong trying to get this special attack gadget to work. Any help/ hints would be much appreciated.

edit: old
Last edited by bobthedinosaur on 16 Jun 2010, 23:59, edited 1 time in total.
thedude
Posts: 66
Joined: 21 Aug 2009, 12:47

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

Post by thedude »

Last time when I tried to make a custom-command-gadget it did not work for me when I tried to use CommandFallback but when I used the AllowCommand function instead it seemed to work.
User avatar
bobthedinosaur
Blood & Steel Developer
Posts: 2702
Joined: 25 Aug 2004, 13:31

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

Post by bobthedinosaur »

Umm, for some reason all of my cegs no longer appear. But I am not getting any errors in the info log, whats the most likely cause of this?
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6241
Joined: 29 Apr 2005, 01:14

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

Post by FLOZi »

bobthedinosaur wrote:Umm, for some reason all of my cegs no longer appear. But I am not getting any errors in the info log, whats the most likely cause of this?
broken resources.tdf/lua maybe?
User avatar
bobthedinosaur
Blood & Steel Developer
Posts: 2702
Joined: 25 Aug 2004, 13:31

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

Post by bobthedinosaur »

thats what it was. a duplicate entry, caused it all to not work.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6241
Joined: 29 Apr 2005, 01:14

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

Post by FLOZi »

You could always avoid such issues by automating the process :wink:
User avatar
bobthedinosaur
Blood & Steel Developer
Posts: 2702
Joined: 25 Aug 2004, 13:31

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

Post by bobthedinosaur »

i am an idiot.. note to self look for stray "/"
User avatar
bobthedinosaur
Blood & Steel Developer
Posts: 2702
Joined: 25 Aug 2004, 13:31

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

Post by bobthedinosaur »

unrelated from last post:

can you use some kind of cob id or height measurement to find the unit type that is transporting your unit with out other units that might be nearby to throw off the detection?
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6241
Joined: 29 Apr 2005, 01:14

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

Post by FLOZi »

bobthedinosaur wrote:unrelated from last post:

can you use some kind of cob id or height measurement to find the unit type that is transporting your unit with out other units that might be nearby to throw off the detection?
You want to find the unitid of the transporter?

COB:

Code: Select all

#define TRANSPORT_ID              94 // get
lua:

Code: Select all

Spring.GetUnitTransporter 
 ( number unitID ) -> nil | number unitID
edit: Oh, you said unit type. Well with lua it's easy enough to find the type of the given unitid. Cob less so, either using the height or use cob->lua.
User avatar
bobthedinosaur
Blood & Steel Developer
Posts: 2702
Joined: 25 Aug 2004, 13:31

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

Post by bobthedinosaur »

so in cob, i would have to get transport id and do a height check on the same position of the transport to figure it out?
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

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

Post by KDR_11k »

There should be a COB ID as well, get the transport's unit ID, then ask for its COB ID
User avatar
bobthedinosaur
Blood & Steel Developer
Posts: 2702
Joined: 25 Aug 2004, 13:31

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

Post by bobthedinosaur »

you can use define COB_ID 100 // get on targets or units other than the unit who's script you are running (currently working with)?

how would that work?
transid = get 94 //TRANSPORT_ID get
if ( goodid == get 100(transid) )
{ do soemthing}
User avatar
yuritch
Spring 1944 Developer
Posts: 1018
Joined: 11 Oct 2005, 07:18

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

Post by yuritch »

Add this to fbi (or lua if you're using that) of the unit which type you need to detect:

Code: Select all

CobID=99;
Then, when you do get COB_ID(unitid) on that unit, you'll get a 99.
So if you need to detect say ground transport and air transport, you can set all ground transports to CobID=99 and all air transports to CobID=100. Multiple unit types can have same CobID, it's only used for this get COB_ID call AFAIK.

Code: Select all

#define GROUND_TRANS 99
#define AIR_TRANS 100
#define SEA_TRANS 101
...
tmpid=get COB_ID(transid);
if(tmpid == GROUND_TRANS)
{
 foo bar;
}
if(tmpid == AIR_TRANS)
{
 foo bar;
}
if(tmpid == SEA_TRANS)
{
 foo bar;
}
...
Locked

Return to “Game Development Tutorials & Resources”