Forums » Air Combat & Civil Aviation » General - Air Combat (Helicopters) » Comanche Gold Modding Breakthrough -- Triggers


Page 1 of 4 1 2 3 4 >
Topic Options
Rate This Topic
Hop to:
#3161595 - 12/20/10 02:02 PM Comanche Gold Modding Breakthrough -- Triggers
DavidC99 Offline
Junior Member

Registered: 12/16/10
Posts: 74
Good news for Comanche Gold fans who care: We should hopefully soon have full -- or near-full -- support over triggers!

Yes, triggers!

For those who are wondering what this means, custom maps have just had a new door opened to them. We can make custom missions that have multiple ways to win or lose, depending on what conditions are fulfilled. For example, we can make a mission in which you win either by protecting a friendly unit from attack, or, if you fail to save him, by racing over to the enemy's heavily guarded HQ and bombing it to pieces in revenge. We might be able make missions with a time limit, so you only have to hold out from a major attack for so long before you win, pretending for a moment that the enemy is low on fuel and only has a brief moment to overrun your base. We can also change AI groupings to patrol different areas if enemy radar stations are destroyed or not, or even if you're spotted by certain units, making penetration easier or more difficult, depending on the circumstances.

This isn't even counting some of the other things we can do like adding our own sounds, music, and text instructions to our missions.

Now triggers have always apparently been able to be added manually, but the issue with which I've been fighting currently is how to group objects. This is what you'd need in order to distinguish, for example, your teammate from an enemy hokum in a particular trigger. I've finally discovered how to do this, but it's a laborious, long, manual, and ugly process. I've had to write a rather crude tool to speed up the process, and this appears to be working for me (although I'm not sure it's bug free). It's not certain that everything will work, but tests have been very promising.

If people are interested in this, let me know, and I'll continue posting more information on this. Be forewarned -- it's not all that easy to get into right away. It requires you to do some extra work to get right, but it should be easier once you get used to it. For example, the first thing to know is that you'll have to learn how to pack and unpack .MRF files. Sounds difficult perhaps, until you realize that if you've unpacked a .PFF file, it's the same thing. wink

I can write tutorials or some other form of assistance in creating maps to work with triggers. I at least want to create a demo map and release that as an example. I think a number of us should consider making some actual campaigns. If all goes well, I'll be trying to release my own campaign(s) in the near future -- maybe even playable in multiplayer.
_________________________
DavidC99

Top
#3161673 - 12/20/10 03:21 PM Re: Comanche Gold Modding Breakthrough -- Triggers [Re: DavidC99]
ufolev Offline
Member

Registered: 03/19/08
Posts: 150
Just 3 words:

GO ON FORWARD !!!



ufolev :-)

Top
#3161726 - 12/20/10 04:20 PM Re: Comanche Gold Modding Breakthrough -- Triggers [Re: DavidC99]
DavidC99 Offline
Junior Member

Registered: 12/16/10
Posts: 74
Triggers for Player Waypoints.

Our goal will be to place a text trigger for the player when he flies to waypoint 1. This means when he flies past waypoint 1, a little bit of text will be displayed at the bottom of his screen.

What you'll need:
  • A simple map with waypoints assigned to the player. It is possible to use ufolev's custom map OIL FLAME for this experiment, since it works just fine. Alternatively, if you want to do this yourself and need help doing this part, Editor.pdf, which comes with the game, should explain how waypoints work.
  • An understanding of how to pack and unpack a .PFF file. A .PFF viewer such as FwO Raven's pff utility is recommended if you don't have a preferred one.

Instructions:
  1. If you have a properly configured MRF file, such as ufolev's OIL FLAME map mentioned earlier, you may skip so step 3.
  2. Otherwise:
    1. Create, or open an existing, custom map that contains some basic waypoints assigned to the Player.
    2. Make sure the waypoints are named with an 'A', like "A1", "A2", etc. etc.. It should be by default unless you changed which waypoint groups you're editing.
    3. Make sure the Player's waypoint grouping should be set to A. It should be fine by default.
    4. Export the map as an MRF file.
  3. Open the MRF file with a working PFF viewer.
  4. Extract USER.INF and open it with a text editor. It should look like this:
    Code:
    >TEXTv
    |.|1|bMission Name
    |l|-
    |.|1|wDownloading Mission Parameters...
    <
  5. Make the following changes so your file looks like this:
    Code:
    >TEXTv
    |.|1|bMission Name
    |l|-
    |.|1|wDownloading Mission Parameters...
    <
    >RM01
    Passing Waypoint 1
    <
  6. Now extract USER.MIS.
  7. Find the part that looks like this:
    Code:
    <
    ;---------> Data ENDS <----------
  8. The '<' character on the line by itself indicates the end of the triggers. You'll want to change that part of the file to look like this:
    Code:
    if
    waypoint, P, A1
    then
    text, 1
    <
    ;---------> Data ENDS <----------
  9. Place both USER.INF and USER.MIS back into your MRF file.
  10. Load the mission normally and verify that when you pass waypoint 1, you receive a beep along with a text message at the bottom of the screen telling you "Passing Waypoint 1". If it didn't work, go back over each step.

Explanation and Conclusion:
  • Novalogic probably thought it was a bad idea to make users load custom missions with multiple files, so they opted to provide a way for custom missions to be loaded with a single file by making the game understand MRF files -- PFF files by a different extension. We can extra files from them now, edit, and then repack them, adding features that the editor just doesn't support.
  • Entries of "RM" in the .INF file followd by a two digit number correspond to text messages that you can send to the player by number. When we wrote "text, 1" in the trigger, we were telling the game to look for a text entry of RM01. It might help to think of "RM" as "Radio Message" found in the mission INFormation file.
  • Objects are grouped by letter. By default the player object is placed in group "P". This is good to know, since it lets you write triggers for the player.

Other possibilities
Instead of text, think about playing sound files, including custom ones, perhaps alerting the player about something. Instead of "text, <id>" the command inside the trigger would be "play, <filename>".
_________________________
DavidC99

Top
#3161930 - 12/20/10 10:36 PM Re: Comanche Gold Modding Breakthrough -- Triggers [Re: DavidC99]
ufolev Offline
Member

Registered: 03/19/08
Posts: 150
Thank you.
Will use your suggestions.

ufolev

Top
#3162863 - 12/21/10 09:50 PM Re: Comanche Gold Modding Breakthrough -- Triggers [Re: DavidC99]
DavidC99 Offline
Junior Member

Registered: 12/16/10
Posts: 74
I ran into a setback in group IDs. It's still very much possible to group objects, but it's just a huge pain to figure out which objects are the ones you are trying to select in order to group. To be honest, I'm actually really unhappy that Novalogic went out of their way to make it this difficult for us to make proper missions for this game.

Anyway, I did make a custom mission complete with a few simple triggers and finishing touches like adding different colors to the briefing text (although I think I may have overdid it biggrin ), but this mission is really, really hard... It's not as much hard as it is unfair. I think I may have to work on the dynamics a little more, but the proof of concept is there.

Hopefully, I'll get it fixed up and subsequently find a quick way to make it available to everyone.
_________________________
DavidC99

Top
#3162891 - 12/21/10 10:36 PM Re: Comanche Gold Modding Breakthrough -- Triggers [Re: DavidC99]
ufolev Offline
Member

Registered: 03/19/08
Posts: 150
Hi DC99

I can't wait to try it LOL.
Give it on CG custom mission checkpoint,
as soon as it possible, please!

ufolev :-)


Edited by ufolev (12/21/10 11:03 PM)

Top
#3163273 - 12/22/10 10:15 AM Re: Comanche Gold Modding Breakthrough -- Triggers [Re: DavidC99]
DavidC99 Offline
Junior Member

Registered: 12/16/10
Posts: 74
I have added new music to the mission. It works just fine. smile
_________________________
DavidC99

Top
#3163699 - 12/22/10 06:37 PM Re: Comanche Gold Modding Breakthrough -- Triggers [Re: DavidC99]
DavidC99 Offline
Junior Member

Registered: 12/16/10
Posts: 74
I would appreciate it if someone would be willing to test the map and verify that this new mission works for them. I know others might do things of which I haven't even thought, so I'd like to know if I missed anything major.

Features of the mission that should work:
  • Audio and text occur when 2-7 dies.
  • Base tells you to take off, and 2-6 responds.
  • Sounds and messages on the bottom of the screen direct you as to what to do at all times in a logical manner, like in a regular mission.
  • New music for this mission.
I will say, I think that there is room for improvement in the mission, but at the same time, I think that it's OK for a first mission, especially given the amount of work with triggers.

If someone is willing to test it, I'd then consider releasing it, pending feedback.
_________________________
DavidC99

Top
#3163815 - 12/23/10 12:05 AM Re: Comanche Gold Modding Breakthrough -- Triggers [Re: DavidC99]
ufolev Offline
Member

Registered: 03/19/08
Posts: 150
Hi DC99

Let me test it please!


ufolev :-)

Top
#3163819 - 12/23/10 12:31 AM Re: Comanche Gold Modding Breakthrough -- Triggers [Re: DavidC99]
DavidC99 Offline
Junior Member

Registered: 12/16/10
Posts: 74
Sure.

I know you gave me your Email address already, but I lost it by accident when I closed the window and realized Kali wasn't logging the contents. :/ If you can give it to me again, I'll send you the map.
_________________________
DavidC99

Top
Page 1 of 4 1 2 3 4 >
Topic Options
Rate This Topic
Hop to:


Forum Use Agreement | Privacy Statement | SimHQ Staff
Copyright 1997-2012, SimHQ Inc. All Rights Reserved.