Devices

Please post here for questions and discussion about scenario design, art and sound modding and the game editor for WITP Admiral's Edition.

Moderators: wdolson, MOD_War-in-the-Pacific-Admirals-Edition

Post Reply
dbmsts
Posts: 135
Joined: Fri Feb 18, 2011 7:56 am

Devices

Post by dbmsts »

I wanted to know what are the "Air Device" and "Air Use" Fields used for in the Devices section of the Editor.
User avatar
tanjman
Posts: 668
Joined: Sat Jan 26, 2002 10:00 am
Location: Griffin, GA

RE: Devices

Post by tanjman »

ORIGINAL: dbmsts

I wanted to know what are the "Air Device" and "Air Use" Fields used for in the Devices section of the Editor.

Do you mean Alt Device & Alt Use? If so, the following was gleaned from a post by michealm.


Alt Device

Basically you can link devices in a sequence specifying what missions can use said device. The code will attempt to swap out any device that has a 'Alt use' value that is applicable to the mission being executed. It will find the first alternate device that is applicable for the mission being executed.

It is a simple method that can be horribly broken if you try to chain too many devices together or give it conflicting mission profiles.

For example: The 100kg SAP can be linked to the 100kg GP linked back to the 100kg SAP. This is done by putting the next device in the chain in the 'Alt device' field of the device\n (100kg SAP has AltDev of 100kg GP; which has AltDev of 100kg SAP) Now to keep the SAP limited to naval attack, you put 6 in the 'Alt use' field, and 120 (to use for land and AF attacks) for the other linked device.

Alt Use

Below are the values for the 'Alt use'. Just add the numbers of the missions that can use the device together.
- define PM_NAVAL_ATTACK 2 // used for naval attacks
- define PM_NAVAL_ATTACK2 4 // alternate for naval attack (like torp replacement)
- define PM_LAND_ATTACK 8 // used for land (ground/port) attack
- define PM_LAND_ATTACK2 16 // alternate for land (ground/port) attack
- define PM_AF_ATTACK 32 // used for airfield attack
- define PM_AF_ATTACK2 64 // alternate for airfield attack
Gunner's Mate: A Boatswain's Mate with a hunting license.
dbmsts
Posts: 135
Joined: Fri Feb 18, 2011 7:56 am

RE: Devices

Post by dbmsts »

Sorry for my mistake. Yes it's Alt Device and Alt Use. Thanks for the reply that really helped. However there is one more question, when in aircraft section I change a bomb type for a particular plane, for e.g. I changed the bomb carried by the I-15-III to #201 "100 kg GP Bomb" instead of the #1880 "100 kg GP Bomb". When I went to the airgroups section and looked at the chinese squadrons flying the I-15-III, I noticed that the weapon was still the #1880 "100 kg GP Bomb", so I selected the drop down menu for the 'air class' and clicked on the I-15-III again then the weapon changed to what I wanted. Is there an easier way to update all the airgroups whenever I make a change in the aircraft section?
User avatar
Herrbear
Posts: 883
Joined: Sun Jul 25, 2004 9:17 pm
Location: Glendora, CA

RE: Devices

Post by Herrbear »

ORIGINAL: tanjman

ORIGINAL: dbmsts

I wanted to know what are the "Air Device" and "Air Use" Fields used for in the Devices section of the Editor.

Do you mean Alt Device & Alt Use? If so, the following was gleaned from a post by michealm.


Alt Device

Basically you can link devices in a sequence specifying what missions can use said device. The code will attempt to swap out any device that has a 'Alt use' value that is applicable to the mission being executed. It will find the first alternate device that is applicable for the mission being executed.

It is a simple method that can be horribly broken if you try to chain too many devices together or give it conflicting mission profiles.

For example: The 100kg SAP can be linked to the 100kg GP linked back to the 100kg SAP. This is done by putting the next device in the chain in the 'Alt device' field of the device\n (100kg SAP has AltDev of 100kg GP; which has AltDev of 100kg SAP) Now to keep the SAP limited to naval attack, you put 6 in the 'Alt use' field, and 120 (to use for land and AF attacks) for the other linked device.

Alt Use

Below are the values for the 'Alt use'. Just add the numbers of the missions that can use the device together.
- define PM_NAVAL_ATTACK 2 // used for naval attacks
- define PM_NAVAL_ATTACK2 4 // alternate for naval attack (like torp replacement)
- define PM_LAND_ATTACK 8 // used for land (ground/port) attack
- define PM_LAND_ATTACK2 16 // alternate for land (ground/port) attack
- define PM_AF_ATTACK 32 // used for airfield attack
- define PM_AF_ATTACK2 64 // alternate for airfield attack

I am confused as I see no 40 in the list. Device 204 is Alt Dev 198; Alt Use 40. What does the 40 mean? The other way follows: Device 198 is Alt Dev 204; Alt Use 4

Thanks.

Ambassador
Posts: 1756
Joined: Fri Jan 11, 2008 5:15 pm
Location: Brussels, Belgium

RE: Devices

Post by Ambassador »

You have to add the numbers.  40 is 32 + 8 : land and airfield attacks.  12 would be 4+8 (naval & land), 56 is 32+16+8 (both land and airfield).  The 120 referred to by tanjman is 8+16+32+64 (all land and airfield attacks).

With such a combination of "base" numbers, any number is a unique addition of some of the others.  Hence why a single field to determine the mission(s) where an alternate device is used : a single field, whether only one or several missions are concerned.
User avatar
Herrbear
Posts: 883
Joined: Sun Jul 25, 2004 9:17 pm
Location: Glendora, CA

RE: Devices

Post by Herrbear »

ORIGINAL: Ambassador

You have to add the numbers.  40 is 32 + 8 : land and airfield attacks.  12 would be 4+8 (naval & land), 56 is 32+16+8 (both land and airfield).  The 120 referred to by tanjman is 8+16+32+64 (all land and airfield attacks).

With such a combination of "base" numbers, any number is a unique addition of some of the others.  Hence why a single field to determine the mission(s) where an alternate device is used : a single field, whether only one or several missions are concerned.
I think I understand. So for example (these devices are made up)


Device #10 500 lb Bomb------------Device #20 3.5" Ground Rocket
Alt Dev #20---------------------------Alt Dev #10
Alt Use 46 (32+8+4+2)-------------Alt Use 80 (64+16)

Device #10 Use for all naval attacks and land and airfield attack
Device #20 Use for alternate land and alternate airfield attack

Would this be correct?

Thank you.


Ambassador
Posts: 1756
Joined: Fri Jan 11, 2008 5:15 pm
Location: Brussels, Belgium

RE: Devices

Post by Ambassador »

That's how I understand it (because I encoutered that type of coding in other domains), but I'm no privy to the inner workings of the game.
User avatar
chesmart
Posts: 904
Joined: Sun Jan 14, 2007 8:51 pm
Location: Malta

RE: Devices

Post by chesmart »

So if i understand correctly we can change the settings when aircraft can use torpedoes in port attacks ?
Post Reply

Return to “Scenario Design and Modding”