Air transport fix.
Moderator: Moderators
Air transport fix.
Ok, as we know we need isairbase to have unit fire from a transport. This causes a problem because airbases also repair aircraft. So transports would get occupied by aircraft seeking repair.
So I sepperated the tags.
Isairbase will no longer be needed for transports to have units firing from them.
Instead they can use a tag:
isfireplatform
for that purpose purpose of denoting a transport is a platform a unit can fire weapons or it's nano-gun from..
Patch here
This is just a short little patch I tested it and it worked. Nothing complicated.. I think it was like 3 lines I changed. Anyway, here you go devs.
So I sepperated the tags.
Isairbase will no longer be needed for transports to have units firing from them.
Instead they can use a tag:
isfireplatform
for that purpose purpose of denoting a transport is a platform a unit can fire weapons or it's nano-gun from..
Patch here
This is just a short little patch I tested it and it worked. Nothing complicated.. I think it was like 3 lines I changed. Anyway, here you go devs.
Last edited by smoth on 29 Jun 2006, 08:57, edited 1 time in total.
-
- Posts: 854
- Joined: 28 Jan 2005, 18:15
- unpossible
- Posts: 871
- Joined: 10 May 2005, 19:24
@AF: but why the heck would you have an FBI tag that, when used on a transport means "transported units can fire" and on a repair pad would mean "planes land on this to get repaired"... it's just another dumb throwback to OTA glitchiness... the use of isairbase was probably a hack that people figured out to trick OTA to do this in the first place.
- unpossible
- Posts: 871
- Joined: 10 May 2005, 19:24
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Lazy peoplesPatch wrote:Index: rts/Sim/Units/UnitDef.h
===================================================================
--- rts/Sim/Units/UnitDef.h (revision 1538)
+++ rts/Sim/Units/UnitDef.h (working copy)
@@ -172,7 +172,9 @@
float loadingRadius; //for transports
int transportCapacity;
int transportSize;
- bool isAirBase;// should the carried units still be able to shoot?
+ //$$
+ bool isfireplatform;// should the carried units still be able to shoot?
+ bool isAirBase;
float transportMass;
bool canCloak; //if the unit can cloak
Index: rts/Sim/Units/UnitDefHandler.cpp
===================================================================
--- rts/Sim/Units/UnitDefHandler.cpp (revision 1538)
+++ rts/Sim/Units/UnitDefHandler.cpp (working copy)
@@ -291,6 +291,7 @@
tdfparser.GetDef(ud.transportSize, "0", "UNITINFO\\transportsize");
tdfparser.GetDef(ud.transportCapacity, "0", "UNITINFO\\transportcapacity");
+ ud.isfireplatform=!!atoi(tdfparser.SGetValueDef("0", "UNITINFO\\isfireplatform").c_str()); //$$
ud.isAirBase=!!atoi(tdfparser.SGetValueDef("0", "UNITINFO\\isAirBase").c_str());
ud.loadingRadius=220;
tdfparser.GetDef(ud.transportMass, "100000", "UNITINFO\\TransportMass");
Index: rts/Sim/Units/UnitTypes/TransportUnit.cpp
===================================================================
--- rts/Sim/Units/UnitTypes/TransportUnit.cpp (revision 1538)
+++ rts/Sim/Units/UnitTypes/TransportUnit.cpp (working copy)
@@ -94,7 +94,7 @@
unit->AddDeathDependence (this);
unit->transporter = this;
unit->toBeTransported=false;
- if (!unitDef->isAirBase)
+ if (!unitDef->isfireplatform)//$$
unit->stunned=true; //make sure unit doesnt fire etc in transport
unit->UnBlock();
loshandler->FreeInstance(unit->los);
@@ -126,7 +126,7 @@
unit->transporter=0;
if(CTAAirMoveType* am=dynamic_cast<CTAAirMoveType*>(moveType))
unit->moveType->useHeading=true;
- unit->stunned=false; // de-stun in case it isairbase=0
+ unit->stunned=false; // de-stun in case it isfireplatform=0
unit->Block();
loshandler->MoveUnit(unit,false);
unit->moveType->LeaveTransport();

Code: Select all
ud.isAirBase=!!atoi(tdfparser.SGetValueDef("0", "UNITINFO\\isAirBase").c_str());
Code: Select all
ud.isAirBase=atoi(tdfparser.SGetValueDef("0", "UNITINFO\\isAirBase").c_str());
Code: Select all
int isfp= atoi(tdfparser.SGetValueDef("999", "UNITINFO\\isfireplatform").c_str());
if((isfp == 999)&&(ud.isAirBase))
{
ud.isfireplatform= !ud.builder;//$$
ud.isAirBase = ud.builder;
}else{
ud.isfireplatform= (bool)isfp;//$$
}
ud.isAirBase=!!atoi(tdfparser.SGetValueDef("0", "UNITINFO\\isAirBase").c_str());
You are making it overly complicated AF.
Look it is all very simple..>
I didn't change anything All I did was add 3 things.
I added:
ISFIREPLATFORM TAG as a valid FBI value, MIMIKING the structure used for the isairbase tag.
I then told the transports to use this to determine the paralysis status of a unit on a transport.
Quit nitpicking the code. You are trying t o complicate things. It still is backwards compatible.
I didn't change this. That is how they origonally had it.ud.isAirBase=!!atoi(tdfparser.SGetValueDef("0", "UNITINFO\\isAirBase").c_str());
Look it is all very simple..>
I didn't change anything All I did was add 3 things.
I added:
ISFIREPLATFORM TAG as a valid FBI value, MIMIKING the structure used for the isairbase tag.
I then told the transports to use this to determine the paralysis status of a unit on a transport.
Quit nitpicking the code. You are trying t o complicate things. It still is backwards compatible.
Last edited by smoth on 29 Jun 2006, 20:52, edited 1 time in total.
We don't need this, It is bad, what if I want to have a transport and repair pad... which I do.AF wrote:Not needed,
just check
if (UnitDef->builder == true){
// ITS A REPAIR PAD
}else{
//IT'S A TRANSPORT!!!!
}
This is a simple fix, AF you do not do this to anyone else who writes a patch. Why are you nitpicking 2 lines of new code?
The exact changes
Code: Select all
- bool isAirBase;// should the carried units still be able to shoot?
+ //$$
+ bool isfireplatform;// should the carried units still be able to shoot?
+ bool isAirBase;
- unit->stunned=false; // de-stun in case it isairbase=0
+ unit->stunned=false; // de-stun in case it isfireplatform=0
- if (!unitDef->isAirBase)
+ if (!unitDef->isfireplatform)//$$
- unit->stunned=false; // de-stun in case it isairbase=0
+ unit->stunned=false; // de-stun in case it isfireplatform=0
Last edited by smoth on 29 Jun 2006, 20:58, edited 1 time in total.
That would be executed if the user DID NOT define the extra tag you added
Please dont be so overly hostile about it.
You would define both as 1. This is a backwards compatible measure to prevent aircraft following transports for repair. Afterall your change doesnt fix the problem unless the units fbi is changed. My solution fixes that while keeping your addition intact.what if I want to have a transport and repair pad...
Please dont be so overly hostile about it.
shortcut for converting to bool, seems to be needed with certains MSVCsAF wrote:double negative? "!!"== if it is not not ?Code: Select all
ud.isAirBase=!!atoi(tdfparser.SGetValueDef("0", "UNITINFO\\isAirBase").c_str());
That would be executed if the user DID NOT define the extra tag you added[/quote]
wth.... just come on team speak... read your pm.
Look AF, it is very, very simple.... on a transport a unit is paralysed by the transport. It is in the code.
There is a condition that IF the transport isairbase then it will not paralyse the unit.
I created a needed sepperation of the two by adding a tag. I do not know why you are so oppossed to it. If you knew how to fix it why you didn't already submit a patch. Is this what you are going to do when I submit a patch? every time I do something?
wth.... just come on team speak... read your pm.
AF wrote:You would define both as 1. This is a backwards compatible measure to prevent aircraft following transports for repair. Afterall your change doesnt fix the problem unless the units fbi is changed. My solution fixes that while keeping your addition intact.
Look AF, it is very, very simple.... on a transport a unit is paralysed by the transport. It is in the code.
There is a condition that IF the transport isairbase then it will not paralyse the unit.
I created a needed sepperation of the two by adding a tag. I do not know why you are so oppossed to it. If you knew how to fix it why you didn't already submit a patch. Is this what you are going to do when I submit a patch? every time I do something?
I am not, this is THE ONLY TIME you have nitpicked a patch.AF wrote:Please dont be so overly hostile about it.