Code for vehicles to take away tickets
-
Rabbit
- Posts: 7818
- Joined: 2006-12-17 15:14
Code for vehicles to take away tickets
What code did PR us to cause a ticket loss for when a vehicle is destroyed? Also where would you find it and apply it?
AfSoccer "I just don't see the natural talent."

-
Rhino
- Retired PR Developer
- Posts: 47909
- Joined: 2005-12-13 20:00
Re: Code for vehicles to take away tickets
We used python code, which all gamemodes and tickets etc are controlled by 
Code: Select all
# Defaults:
# -10 = tanks, jets, attack helicopters, ifvs
# -5 = apcs, aavs, transport helicopters, recon
# -2 = jeeps, trucks
# -1 = soldiers
C['TICKETS'] = {
VEHICLE_TYPE_ARMOR : -10,
VEHICLE_TYPE_IFV : -10,
VEHICLE_TYPE_JET : -10,
VEHICLE_TYPE_HELIATTACK : -10,
VEHICLE_TYPE_HELI : -5,
VEHICLE_TYPE_RECON : -5,
VEHICLE_TYPE_AAV : -5,
VEHICLE_TYPE_APC : -5,
VEHICLE_TYPE_TRANSPORT : -2,
VEHICLE_TYPE_SOLDIER : -1
}-
Rabbit
- Posts: 7818
- Joined: 2006-12-17 15:14
Re: Code for vehicles to take away tickets
If I was looking to increase the amount of tickets lost for a vehicle, from lets say -10 to -50, how would I go about changing this for 1 level?'[R-DEV wrote:Rhino;1839424']We used python code, which all gamemodes and tickets etc are controlled by
Code: Select all
# Defaults: # -10 = tanks, jets, attack helicopters, ifvs # -5 = apcs, aavs, transport helicopters, recon # -2 = jeeps, trucks # -1 = soldiers C['TICKETS'] = { VEHICLE_TYPE_ARMOR : -10, VEHICLE_TYPE_IFV : -10, VEHICLE_TYPE_JET : -10, VEHICLE_TYPE_HELIATTACK : -10, VEHICLE_TYPE_HELI : -5, VEHICLE_TYPE_RECON : -5, VEHICLE_TYPE_AAV : -5, VEHICLE_TYPE_APC : -5, VEHICLE_TYPE_TRANSPORT : -2, VEHICLE_TYPE_SOLDIER : -1 }
AfSoccer "I just don't see the natural talent."

-
Rhino
- Retired PR Developer
- Posts: 47909
- Joined: 2005-12-13 20:00
Re: Code for vehicles to take away tickets
couldn't do it for one level in the current format, would require a big rewrite of the code. The simplest way would be to clone the vehicle and make it into a new category but even that isn't straight forward as I've been looking into this somewhat myself to try and make the Atlantic Conveyor in PR:F cost 50 tickets but the code is quite a mine field and our main python coder is busy right now so haven't been able to get that sorted yet 
-
Rabbit
- Posts: 7818
- Joined: 2006-12-17 15:14
Re: Code for vehicles to take away tickets
Damn, I was really hoping it would be like FH2's TMP where you can take a basic line of code and mold it to fit what you need. Where you can do things like "rem make objectives", "rem make ______ never destroyable"
or " rem disable _____" Life would be great.
or " rem disable _____" Life would be great.
AfSoccer "I just don't see the natural talent."

-
ExeTick
- Posts: 855
- Joined: 2011-01-13 22:50
Re: Code for vehicles to take away tickets
if you get wounded and you need a medic to revive you do you lose 1 ticket?
and when you go unreviveable you lose 1 ticket or do you only lose 1 ticket?
some people say you lose 2 tickets when you die as infantry. 1 ticket when you get wounded and 1 when you get unreviveable.
and when you go unreviveable you lose 1 ticket or do you only lose 1 ticket?
some people say you lose 2 tickets when you die as infantry. 1 ticket when you get wounded and 1 when you get unreviveable.

-
Psyrus
- Retired PR Developer
- Posts: 3841
- Joined: 2006-06-19 17:10
Re: Code for vehicles to take away tickets
It's -1 ticket for getting critically woundedExeTick wrote:if you get wounded and you need a medic to revive you do you lose 1 ticket?
and when you go unreviveable you lose 1 ticket or do you only lose 1 ticket?
some people say you lose 2 tickets when you die as infantry. 1 ticket when you get wounded and 1 when you get unreviveable.
It's -1 ticket for giving up (or getting dead-dead).
So if you go down and have to give up, it's -2 tickets.
If you are insta-killed (for example on a ladder or HMG emplacement), it should be just -1 ticket.
-
ExeTick
- Posts: 855
- Joined: 2011-01-13 22:50
Re: Code for vehicles to take away tickets
so if you die in a vehicle you only lose 1 ticket?
lets say you die in a IFV you lose 10 tickets for the vehicle and only 2 tickets for 2 crewman?
lets say you die in a IFV you lose 10 tickets for the vehicle and only 2 tickets for 2 crewman?

-
Psyrus
- Retired PR Developer
- Posts: 3841
- Joined: 2006-06-19 17:10
Re: Code for vehicles to take away tickets
To the best of my knowledge, yes that's the case.ExeTick wrote:so if you die in a vehicle you only lose 1 ticket?
lets say you die in a IFV you lose 10 tickets for the vehicle and only 2 tickets for 2 crewman?
-
rPoXoTauJIo
- PR:BF2 Developer
- Posts: 1979
- Joined: 2011-07-20 10:02
Re: Code for vehicles to take away tickets
!r waste 
Always thought players inside vehicles costs 2 tickets too. Tnx for info!
Always thought players inside vehicles costs 2 tickets too. Tnx for info!
-
Rabbit
- Posts: 7818
- Joined: 2006-12-17 15:14
Re: Code for vehicles to take away tickets
Well working off these codes I have been playing around with something on sort of a skirmish/objective layer. Pretty much what it is small skirmish sized layer based off an attack and defend gameplay.
In this case I'm going to use the Camp Bastion attack as an example. I built it on a skirmish layer so tickets are only 150. Build an airfield, in this case it was the hanger section of the base and placed several helicopters around and supply trucks. I then set code as to make them un able to be entered and also adjusted their hitpoints so they are slightly harder to destroy. This way when the Taliban attack, they can win 2 ways, by over running the Brits, or destroying enough vehicles to make the Brits lose.
4 Harriers= 40 tickets
4 Apaches= 40 tickets
2 Chinooks= 10 tickets
4 black hawks= 20 tickets
5 supply trucks= 10
For a total of 120 tickets
Just a gamemode I have been playing with
In this case I'm going to use the Camp Bastion attack as an example. I built it on a skirmish layer so tickets are only 150. Build an airfield, in this case it was the hanger section of the base and placed several helicopters around and supply trucks. I then set code as to make them un able to be entered and also adjusted their hitpoints so they are slightly harder to destroy. This way when the Taliban attack, they can win 2 ways, by over running the Brits, or destroying enough vehicles to make the Brits lose.
4 Harriers= 40 tickets
4 Apaches= 40 tickets
2 Chinooks= 10 tickets
4 black hawks= 20 tickets
5 supply trucks= 10
For a total of 120 tickets
Just a gamemode I have been playing with
AfSoccer "I just don't see the natural talent."

-
Rabbit
- Posts: 7818
- Joined: 2006-12-17 15:14
Re: Code for vehicles to take away tickets
Okay, well this is pretty easy to set up, but due to my lack of knowledge of python I have been using the Skirmish layer.
What you need to do to make it work is build a tmp.con.
Next you need to place vehicles that are in NO other layer of your map, so using SP versions alt etc, again, as long as that exact vehicle type is not in ANY other layer.
For example I used the t-90 alt in a layer, so here I have to use the normal t-90.
Now with this code, for every
Another code you can use if you wish to adjust the hit points for vehicles to help gameplay is
100 is very low, for example a couple grenades can destroy it. I used this code in Shikotan for the afghan cave that is blocking entrances this way it doesn't take a combat engineer to get it.
Now lets say after you have the objective, in this case a t90 destroyed, you want the wreak to stay longer and not disappear.
Now if you follow the vehicle tickets when lost that rhino posted, you can figure out how many you want to place to make the defending team loose once all of it's assets are destroyed.
What you need to do to make it work is build a tmp.con.
Next you need to place vehicles that are in NO other layer of your map, so using SP versions alt etc, again, as long as that exact vehicle type is not in ANY other layer.
For example I used the t-90 alt in a layer, so here I have to use the normal t-90.
Code: Select all
rem disable ru_tnk_t90
ObjectTemplate.activeSafe EntryPoint ru_tnk_t90
ObjectTemplate.setEntryRadius 0
ObjectTemplate.activeSafe ru_tnk_t90_DriveEntryPoint
ObjectTemplate.setDriveEntryRadius 0You can not enter it.ru_tnk_90
Another code you can use if you wish to adjust the hit points for vehicles to help gameplay is
Code: Select all
ObjectTemplate.activeSafe DestroyableObject ru_tnk_t90
ObjectTemplate.armor.maxHitPoints 100
ObjectTemplate.armor.hitPoints 100Now lets say after you have the objective, in this case a t90 destroyed, you want the wreak to stay longer and not disappear.
Code: Select all
rem make ru_tnk_t90 never destroyable
ObjectTemplate.activeSafe PlayerControlObject ru_tnk_t90
ObjectTemplate.armor.timeToStayAsWreck 99999
ObjectTemplate.armor.canBeDestroyed 1
AfSoccer "I just don't see the natural talent."


