[WIP] Detonatable, Tripflare and Mines Icon Enabler 1.1 + Mine M15 Fix

Making or wanting help making your own asset? Check in here
Arab
PR:BF2 Developer
Posts: 2898
Joined: 2012-05-18 03:37

[WIP] Detonatable, Tripflare and Mines Icon Enabler 1.1 + Mine M15 Fix

Post by Arab »

Detonatables, Tripflares and Mines Icon Enabler 1.1 + Mine M15 Fix

Adds Vanilla Battlefield 2's 3D icons back, with Remote Detonatables and Tripmines now show a triangle warning icon and Mines, Trip Grenade, Water Jug as the red skull and bones. You can see icons 10m away. This can be reduced or increased easily.



Screenies:
Image
Image

Update 1.2:
-Optimized *all* 3D icons. Now 28 MB smaller!
Objects.dds is saved in DXT1 (Opaque/1-bit Alpha) in Range fit (Fast/LQ), Error Metric is Perceptual and saved in Paint.net

Code: Select all

http://speedy.sh/uFuXF/3D-Mine-Markers-1.2.zip
Update 1.1a:
-Triangle Icon added for Remote Detonatables, Tripflares
IMPORTANT: DO A BACKUP OF THE ORIGINAL ZIPS! DO NOT REPLACE THE ZIP FILES WITH PR, IT WILL OVERWRITE IT AND WILL MAKE YOU LOOSE YOUR PR_EDIT DATA! COPY ONLY INSIDE THE FOLDERS AND DRAG AND DROP TO THE SAME FOLDER AND REPLACE CONTENT (IT SHOULD SAY UPDATING)
Mine Marker 1.1 new:
-Fixed the Water Container showing the wrong icon, instead of the mine/hazard icon.
-Fixed other russian claymore not displaying icon.
3D Explosive and Tripmine Icons 1.1a

Mine Marker 1.1 old:
PR BF2 3D Mine Markers.zip

Mine Disappear Optimization Possible Fix for M15 AT Mine:
Mine Fix.zip

To download, click the top link that says:
Download: PR BF2 3D Mine Markers.zip/Download: Mine Fix.zip (44.59 kb)


Special thanks to the following people for help:
[R-DEV]Rhino, [R-DEV]Mats391, [R-DEV]Mineral, lucky.BOY and anyone else who contributed their knowledge on Battlefield 2 and gave me some hints.
Last edited by Arab on 2014-07-21 01:52, edited 117 times in total.
Rhino
Retired PR Developer
Posts: 47909
Joined: 2005-12-13 20:00

re: [WIP] Detonatable, Tripflare and Mines Icon Enabler 1.1 + Mine M15 Fix

Post by Rhino »

Its not possible for us to have "3D HUD Mine Markers" like vBF2 without nametags and other things showing up for long ranges.... If we could have them we would have them on the IED warning stones etc, which in fact we do but you can only see it when your right on top of the stones...
Image
User avatar
Mats391
PR:BF2 Lead Developer
Posts: 7643
Joined: 2010-08-06 18:06

re: [WIP] Detonatable, Tripflare and Mines Icon Enabler 1.1 + Mine M15 Fix

Post by Mats391 »

[R-DEV]Rhino wrote:Its not possible for us to have "3D HUD Mine Markers" like vBF2 without nametags and other things showing up for long ranges.... If we could have them we would have them on the IED warning stones etc, which in fact we do but you can only see it when your right on top of the stones...
I think nametags are independant from this as you can set distance for object icons and soldier nametags independently. The bigger problem would be that then the icons for flag poles etc would start to show, so those would have to be removed somehow.

Old post when someone suggested that:
'[R-CON wrote:Mats391;1964069']It is not that easy i think. To make the mine 3d marker visible you need to increase the draw distance for all 3d markers and so it will be for everything that uses 3d markers. So you have to go through all the objects that use 3d markers (flags, c4, claymores, bridges (?)...) and remove those, if that is even possible.
Example:
Image

But even then it wont fix the problem that mines that got placed before you join the server are invisible to you.
Imo just changing the system that noone gets punished (besides obviously dieing) would work fine. Maybe admins should get notified about mine teamkills either way to prevent griefing.
Arab
PR:BF2 Developer
Posts: 2898
Joined: 2012-05-18 03:37

re: [WIP] Detonatable, Tripflare and Mines Icon Enabler 1.1 + Mine M15 Fix

Post by Arab »

Oh yes! I remember that. Still working on the mine 3d thing, otherwise I'll try to do the message system like (Mine(s) Nearby, check your sector) and try to make it work somehow.

No problems with flags :D

Transferring from the Mine Teamkill System, I made it to work via an importation of the mine icon and an edit to the nametags.con file.

Tested on Al Basrah Inf on Co-Op Mode, Muttrah Inf on Co-Op Mode :D

Features:
-When you die, and respawn the mine marker still appears which is great.
-In addition, aiming at a friendly displays their user tags much faster.
-Can see from 600+ meters! (Tested on Muttrah). Will test on a larger map.
-When you team-switch e.g from US to MEC and US, the mine marker remains active.
-When mine explodes, mine marker deactivates
-Can turn off and on with ALT (Not sure why)

Image

Problems:
1. Alt-Tabbing briefly makes the mine marker disappear, but it reappears later. This is because ALT turns it off and on.
RESOLVED
Simply pressing ALT will switch it.

nametags.con

Code: Select all

Nametags.createIcon ICRevive
Nametags.setTexture 0 Menu/HUD/Texture/Ingame/Player/playerRevive 0 0 16 16
Nametags.createIcon ICMedic
Nametags.setTexture 0 Menu/HUD/Texture/Ingame/Player/playerMedic 0 0 16 16
Nametags.createIcon ICRepair
Nametags.setTexture 0 Menu/HUD/Texture/Ingame/Player/playerRepair 0 0 16 16
Nametags.createIcon ICAmmo
Nametags.setTexture 0 Menu/HUD/Texture/Ingame/Player/playerAmmo 0 0 16 16

Nametags.createIcon ICVehicleMedic
Nametags.setTexture 0 Menu/HUD/Texture/Ingame/GeneralIcons/empty 0 0 8 8
Nametags.createIcon ICVehicleRepair
Nametags.setTexture 0 Menu/HUD/Texture/Ingame/GeneralIcons/empty 0 0 8 8
Nametags.createIcon ICVehicleAmmo
Nametags.setTexture 0 Menu/HUD/Texture/Ingame/GeneralIcons/empty 0 0 8 8

Nametags.createIcon ICRank
Nametags.setTexture 22 Menu/HUD/Texture/Ingame/GeneralIcons/empty 0 0 16 16

Nametags.createBar ICArmorBar 23 52
Nametags.setTexture 0 Menu/Nametag/ArmorBarFull.dds 0 0 64 16
Nametags.setTexture 1 Menu/Nametag/ArmorBarEmpty.dds 0 0 64 16
Nametags.createBar ICHealthBar 23 52
Nametags.setTexture 0 Menu/Nametag/HealthBarFull.dds 0 0 64 16
Nametags.setTexture 1 Menu/Nametag/HealthBarEmpty.dds 0 0 64 16
Nametags.createBar ICAmmoBar 23 52
Nametags.setTexture 0 Menu/Nametag/AmmoBarFull.dds 0 0 64 16
Nametags.setTexture 1 Menu/Nametag/AmmoBarEmpty.dds 0 0 64 16

Nametags.createIcon ICSquadOrder
Nametags.setTexture 6 Menu/Nametag/SquadOrders.dds 0 0 32 32
Nametags.createIcon ICCommanderOrder
Nametags.setTexture 6 Menu/Nametag/CommanderOrders.dds 0 0 32 32

Nametags.createIcon ICObject
Nametags.setTexture 32 Menu/Nametag/Objects 0 0 16 32

Nametags.createIcon ICObjectVehicleDrop
Nametags.setTexture 1 Menu/HUD/Texture/Ingame/GeneralIcons/empty 0 0 8 8

rem ***Enemy NameTags
rem NameTags.MaxEnemyDistance 0
NameTags.EnemyTagFadeInTime 999
NameTags.EnemyTagFadeOutTime 1
NameTags.EnemyTagDelayTime 999
NameTags.EnemyDotLimit 1

NameTags.MaxFriendlyDistance 1
NameTags.manDownFadeOutTime 300
rem NameTags.deathFadeOutTime 10 

rem attempt to reduce tag visibility, mostly for CP flags, Punkbuster might not like this
NameTags.deployableDistance 0

rem attempt to reduce tag visibility, mostly for CP flags, Punkbuster might not like this
Nametags.setCullDistance TTObject 1/1
Nametags.setCullDistance TTOrder 25/75
I wonder what '32' means, and why some different nametags are set with different values. I know in binary, 0 means off and 1 means on, but placing 16 to the mine marker must mean something.

I'm holding back release until developers say it's ok.

Anyways, I'll upload a video tommorow on it.
Last edited by Arab on 2014-02-25 02:07, edited 26 times in total.
User avatar
Mats391
PR:BF2 Lead Developer
Posts: 7643
Joined: 2010-08-06 18:06

re: [WIP] Detonatable, Tripflare and Mines Icon Enabler 1.1 + Mine M15 Fix

Post by Mats391 »

Arab wrote:Oh yes! I remember that. Still working on the mine 3d thing, otherwise I'll try to do the message system like (Mine(s) Nearby, check your sector) and try to make it work somehow.

No problems with flags :D

Transferring from the Mine Teamkill System, I made it to work via an importation of the mine icon and an edit to the nametags.con file.

Tested on Al Basrah Inf on Co-Op Mode, Muttrah Inf on Co-Op Mode :D

Features:
-When you die, and respawn the mine marker still appears which is great.
-In addition, aiming at a friendly displays their user tags much faster.
-Can see from 600+ meters! (Tested on Muttrah). Will test on a larger map.
-When you team-switch e.g from US to MEC and US, the mine marker remains active.
-When mine explodes, mine marker deactivates
-Can turn off and on with ALT (Not sure why)

Image

Problems:
1. Alt-Tabbing briefly makes the mine marker disappear, but it reappears later. This is because ALT turns it off and on.
RESOLVED
Simply pressing ALT will switch it.

I wonder what '32' means, and why some different nametags are set with different values. I know in binary, 0 means off and 1 means on, but placing 16 to the mine marker must mean something.

I'm holding back release until developers say it's ok.

Anyways, I'll upload a video tommorow on it.
This is what the numbers mean:
For nametags.createBar you need one texture with 0, the empty bar, and one with 1, the full bar. For nametag.createIcon the first number says how many objects are represented within the texture, so for Objects.dds thats 32 icons within the texture. The last 4 numbers are always x-Pos, y-Pos, width, height.
Im not sure why it shows the icon for you with the code above, but if it works i wont complain :D However, 600m is way too much for this. It should be limited to a couple meters.
Not sure if it will help you but here is full list of icon types and tag types:

Code: Select all

Icon types for nametags.createIcon/createBar
ICArmorBar
ICAmmoBar 
ICSquadOrder 
ICCommanderOrder 
ICTarget 
ICObject 
ICObjectVehicleDrop 
ICHealthBar 
ICVehicleMedic 
ICVehicleRepair 
ICVehicleAmmo 
ICAmmo 
ICRank 
ICRevive 
ICMedic 
ICRepair

TagTypes for nametags.setCullDistance
TTObject
TTOrder
TTPlayer
Arab
PR:BF2 Developer
Posts: 2898
Joined: 2012-05-18 03:37

re: [WIP] Detonatable, Tripflare and Mines Icon Enabler 1.1 + Mine M15 Fix

Post by Arab »

Cool, just what I need Mats :D
Last edited by Arab on 2014-02-25 06:44, edited 30 times in total.
User avatar
Mats391
PR:BF2 Lead Developer
Posts: 7643
Joined: 2010-08-06 18:06

re: [WIP] Detonatable, Tripflare and Mines Icon Enabler 1.1 + Mine M15 Fix

Post by Mats391 »

Sounds great.
Did you make sure that it works on dedicated tho? A lot of things behave differently there.
Also did you make sure no other objects start to draw icons? For example the VehicleDrop icon or flags (best to test on test_airfield as that got visible flagpoles). If it shows up for other projectiles (e.g. field dressings or so) it is no problem, just need to edit weapon to not show it.

Another thing about the invisible mines for players that join late. this is an optimization in the bf2 engine. new players do not get information about old projectiles. in normal vbf2 this is no problem as you have no persistent projectiles, but in PR it is. One way you could try to fix it is by having a child object that does get send to new players. Maybe simply adding an effect would work, but i doubt it. This is also something thats hard to test alone :D
Arab
PR:BF2 Developer
Posts: 2898
Joined: 2012-05-18 03:37

re: [WIP] Detonatable, Tripflare and Mines Icon Enabler 1.1 + Mine M15 Fix

Post by Arab »

I'll test on test_airfield, field dressings etc. Not sure about editing it for others, but I want to be independent of help so as to not seem like a leech.

I'll test it, and see about child objects. Not sure what it is, but will do research.

Edit: I found this: http://bf2tech.org/index.php/Game_Engine_Object_Types

What do you think of it?
Last edited by Arab on 2014-02-25 11:17, edited 3 times in total.
User avatar
Mats391
PR:BF2 Lead Developer
Posts: 7643
Joined: 2010-08-06 18:06

re: [WIP] Detonatable, Tripflare and Mines Icon Enabler 1.1 + Mine M15 Fix

Post by Mats391 »

Arab wrote:I'll test on test_airfield, field dressings etc. Not sure about editing it for others, but I want to be independent of help so as to not seem like a leech.

I'll test it, and see about child objects. Not sure what it is, but will do research.

Edit: I found this: Game Engine Object Types - BF2 Technical Information Wiki

What do you think of it?
What you posted is for python stuff, dont worry about that. The child objects are simply objects that you add with ObjectTemplate.addTemplate to the parent object (the projectile in this case).
I just tested your stuff on dedicated and it works fine, no flags icon or other things spotted so far :)
That some weapons are not showing the icon for you is due to the weapon/projectile code, thats easy to fix.
Arab
PR:BF2 Developer
Posts: 2898
Joined: 2012-05-18 03:37

re: [WIP] Detonatable, Tripflare and Mines Icon Enabler 1.1 + Mine M15 Fix

Post by Arab »

So the CO-OP death camera is intentional.
Last edited by Arab on 2014-05-01 01:32, edited 7 times in total.
Arab
PR:BF2 Developer
Posts: 2898
Joined: 2012-05-18 03:37

re: [WIP] Detonatable, Tripflare and Mines Icon Enabler 1.1 + Mine M15 Fix

Post by Arab »

Last edited by Arab on 2014-02-26 08:49, edited 1 time in total.
User avatar
Mineral
Retired PR Developer
Posts: 8534
Joined: 2012-01-02 12:37
Location: Belgium

re: [WIP] Detonatable, Tripflare and Mines Icon Enabler 1.1 + Mine M15 Fix

Post by Mineral »

child objects aren't displayed in max. Child objects are objects that you call with code.

For example you make 2 models/objects: the vehicle and the turret. Then you can call the turret as a child for the vehicle. (not really a good example though).
Image
Arab
PR:BF2 Developer
Posts: 2898
Joined: 2012-05-18 03:37

re: [WIP] Detonatable, Tripflare and Mines Icon Enabler 1.1 + Mine M15 Fix

Post by Arab »

So I installed BF2 Editor following this beautiful tutorial by Rhino https://www.realitymod.com/forum/f189-m ... dding.html

And wow, there's so many things. I'm overwhelmed at the moment, but I'm not quite sure how to make a mine marker appear for late players from an image file that has 13 icons.

Are you sure that it won't display for late players?

What would help guide me me thinks is see how it's handled from vBF2 side, study how the engine works and that.

Under Objects -> Common I found 'Blank Projectile'. Would that do?
Last edited by Arab on 2014-02-26 12:20, edited 2 times in total.
User avatar
Mats391
PR:BF2 Lead Developer
Posts: 7643
Joined: 2010-08-06 18:06

re: [WIP] Detonatable, Tripflare and Mines Icon Enabler 1.1 + Mine M15 Fix

Post by Mats391 »

Arab wrote:So I installed BF2 Editor following this beautiful tutorial by Rhino https://www.realitymod.com/forum/f189-m ... dding.html

And wow, there's so many things. I'm overwhelmed at the moment, but I'm not quite sure how to make a mine marker appear for late players from an image file that has 13 icons.

Are you sure that it won't display for late players?

What would help guide me me thinks is see how it's handled from vBF2 side, study how the engine works and that.

Under Objects -> Common I found 'Blank Projectile'. Would that do?
From experience the mines wont show for players that join late, but im not sure if thats only a problem for the model or also the mine marker.
BlankProjectile is simply a blank projectile, a projectile that deals 0 damage and has very short lifespan. It is only used for weapons that are not meant to shoot anything.
Arab
PR:BF2 Developer
Posts: 2898
Joined: 2012-05-18 03:37

re: [WIP] Detonatable, Tripflare and Mines Icon Enabler 1.1 + Mine M15 Fix

Post by Arab »

Hmm. Well If someone joins in a squad, it shows the mark on 3D and on the map, and same with commander, so the settings are there, and chances are that it might work for late players since it's the vbf2 system (It uses the object.rcon file from bf2 folder under mines)

As for testing it without getting banned, I know from reading a thread by Rhino that I have to disable Punkbuster on the server and password it, and check the logs to see if Punkbuster is cool with it afterwards.

I just found out that 'Alt' in the controller settings leads to putting 3D markers on and off. How cool is that? You can pretty much bind it to any key. Seems like it's not a bug, but a feature by DICE.
Last edited by Arab on 2014-02-26 13:56, edited 1 time in total.
lucky.BOY
Posts: 1438
Joined: 2010-03-03 13:25

re: [WIP] Detonatable, Tripflare and Mines Icon Enabler 1.1 + Mine M15 Fix

Post by lucky.BOY »

Arab wrote:I just found out that 'Alt' in the controller settings leads to putting 3D markers on and off. How cool is that? You can pretty much bind it to any key. Seems like it's not a bug, but a feature by DICE.
What that does that is than on "off" you wont ever see any 3D markers, while with it being "on" you see only what the game (and mod) allow you to see. So in current pr, sometimes disable it by alt-tabbing, and i only realize it when i am close to a squad marker and yet i dont see it.
Arab
PR:BF2 Developer
Posts: 2898
Joined: 2012-05-18 03:37

re: [WIP] Detonatable, Tripflare and Mines Icon Enabler 1.1 + Mine M15 Fix

Post by Arab »

I managed to set the 3D marker on the small_c4 but no mine icon. How could I do that?
User avatar
Mats391
PR:BF2 Lead Developer
Posts: 7643
Joined: 2010-08-06 18:06

re: [WIP] Detonatable, Tripflare and Mines Icon Enabler 1.1 + Mine M15 Fix

Post by Mats391 »

Arab wrote:I managed to set the 3D marker on the small_c4 but no mine icon. How could I do that?
You need to add this to the projectile:

Code: Select all

ObjectTemplate.visibleOn3dMap 1
ObjectTemplate.3dMapIcon 9
The 9 should be the default mine icon, but you could set any number you want there.
Arab
PR:BF2 Developer
Posts: 2898
Joined: 2012-05-18 03:37

re: [WIP] Detonatable, Tripflare and Mines Icon Enabler 1.1 + Mine M15 Fix

Post by Arab »

'[R-CON wrote:Mats391;1987231']You need to add this to the projectile:

Code: Select all

ObjectTemplate.visibleOn3dMap 1
ObjectTemplate.3dMapIcon 9
The 9 should be the default mine icon, but you could set any number you want there.
Thanks!

I've updated the front page with a pic.

So I found a great childsobject to use. ObjectTemplate.HasMobilePhysics 0
MDT - ObjectTemplate - Properties - HasMobilePhysics

All I need to do is add the childobject to the icon/object, center the icons to the marker, update icon design as per feedback, test for all factions local, and then host a private/passworded server for online bug testing purposes and test :D

Basic details:
I will host it, Punkbuster is disabled, Passworded (Sent Privately), contact through skype or IM, organized time and will be through PR_Edit.

Will read logs to see if Punkbuster and post it with permission first if it belongs here or not.
Last edited by Arab on 2014-03-02 15:47, edited 5 times in total.
User avatar
Mats391
PR:BF2 Lead Developer
Posts: 7643
Joined: 2010-08-06 18:06

re: [WIP] Detonatable, Tripflare and Mines Icon Enabler 1.1 + Mine M15 Fix

Post by Mats391 »

Arab wrote:Thanks!

I've updated the front page with a pic.

So I found a great childsobject to use. ObjectTemplate.HasMobilePhysics 0
MDT - ObjectTemplate - Properties - HasMobilePhysics

All I need to do is add the childobject to the icon/object, center the icons to the marker, update icon design as per feedback, test for all factions local, and then host a private/passworded server for online bug testing purposes and test :D

Basic details:
I will host it, Punkbuster is disabled, Passworded (Sent Privately), contact through skype or IM, organized time and will be through PR_Edit.

Will read logs to see if Punkbuster and post it with permission first if it belongs here or not.
Im not following you on the childobject part. Did you set hasMobilePhysics to 0 for the projectiles?
Also i think the 100m+ you have set currently are way too much. I would go with 10m max, but more aloing 2-5m. We dont want floating 3d markers everywhere after all
Post Reply

Return to “PR:BF2 Community Modding”