Code for vehicles to take away tickets

Making or wanting help making your own asset? Check in here
Post Reply
Rabbit
Posts: 7818
Joined: 2006-12-17 15:14

Code for vehicles to take away tickets

Post by Rabbit »

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?
Image

AfSoccer "I just don't see the natural talent."
Image
Rhino
Retired PR Developer
Posts: 47909
Joined: 2005-12-13 20:00

Re: Code for vehicles to take away tickets

Post by Rhino »

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
}
Image
Rabbit
Posts: 7818
Joined: 2006-12-17 15:14

Re: Code for vehicles to take away tickets

Post by Rabbit »

'[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
}
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?
Image

AfSoccer "I just don't see the natural talent."
Image
Rhino
Retired PR Developer
Posts: 47909
Joined: 2005-12-13 20:00

Re: Code for vehicles to take away tickets

Post by Rhino »

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 :(
Image
Rabbit
Posts: 7818
Joined: 2006-12-17 15:14

Re: Code for vehicles to take away tickets

Post by Rabbit »

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.
Image

AfSoccer "I just don't see the natural talent."
Image
ExeTick
Posts: 855
Joined: 2011-01-13 22:50

Re: Code for vehicles to take away tickets

Post by ExeTick »

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.
Image

Image
Psyrus
Retired PR Developer
Posts: 3841
Joined: 2006-06-19 17:10

Re: Code for vehicles to take away tickets

Post by Psyrus »

ExeTick 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 getting critically wounded

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

Post by ExeTick »

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?
Image

Image
Psyrus
Retired PR Developer
Posts: 3841
Joined: 2006-06-19 17:10

Re: Code for vehicles to take away tickets

Post by Psyrus »

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?
To the best of my knowledge, yes that's the case.

rPoXoTauJIo
PR:BF2 Developer
Posts: 1979
Joined: 2011-07-20 10:02

Re: Code for vehicles to take away tickets

Post by rPoXoTauJIo »

!r waste :D

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

Post by Rabbit »

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 :D
Image

AfSoccer "I just don't see the natural talent."
Image
Rabbit
Posts: 7818
Joined: 2006-12-17 15:14

Re: Code for vehicles to take away tickets

Post by Rabbit »

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.

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 0
Now with this code, for every
ru_tnk_90
You can not enter it.

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 100
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.

Code: Select all

rem make ru_tnk_t90 never destroyable
ObjectTemplate.activeSafe PlayerControlObject ru_tnk_t90
ObjectTemplate.armor.timeToStayAsWreck 99999
ObjectTemplate.armor.canBeDestroyed 1
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.
Image

AfSoccer "I just don't see the natural talent."
Image
Post Reply

Return to “PR:BF2 Community Modding”