Previous Thread
Next Thread
Print Thread
Rate This Thread
Hop To
Page 1 of 2 1 2
#3161595 - 12/20/10 10:02 PM Comanche Gold Modding Breakthrough -- Triggers  
Joined: Dec 2010
Posts: 74
DavidC99 Offline
Junior Member
DavidC99  Offline
Junior Member

Joined: Dec 2010
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
Inline advert (2nd and 3rd post)

#3161673 - 12/20/10 11:21 PM Re: Comanche Gold Modding Breakthrough -- Triggers [Re: DavidC99]  
Joined: Mar 2008
Posts: 353
ufolev Offline
Member
ufolev  Offline
Member

Joined: Mar 2008
Posts: 353
Just 3 words:

GO ON FORWARD !!!



ufolev :-)

#3161726 - 12/21/10 12:20 AM Re: Comanche Gold Modding Breakthrough -- Triggers [Re: DavidC99]  
Joined: Dec 2010
Posts: 74
DavidC99 Offline
Junior Member
DavidC99  Offline
Junior Member

Joined: Dec 2010
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
#3161930 - 12/21/10 06:36 AM Re: Comanche Gold Modding Breakthrough -- Triggers [Re: DavidC99]  
Joined: Mar 2008
Posts: 353
ufolev Offline
Member
ufolev  Offline
Member

Joined: Mar 2008
Posts: 353
Thank you.
Will use your suggestions.

ufolev

#3162863 - 12/22/10 05:50 AM Re: Comanche Gold Modding Breakthrough -- Triggers [Re: DavidC99]  
Joined: Dec 2010
Posts: 74
DavidC99 Offline
Junior Member
DavidC99  Offline
Junior Member

Joined: Dec 2010
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
#3162891 - 12/22/10 06:36 AM Re: Comanche Gold Modding Breakthrough -- Triggers [Re: DavidC99]  
Joined: Mar 2008
Posts: 353
ufolev Offline
Member
ufolev  Offline
Member

Joined: Mar 2008
Posts: 353
Hi DC99

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

ufolev :-)

Last edited by ufolev; 12/22/10 07:03 AM.
#3163273 - 12/22/10 06:15 PM Re: Comanche Gold Modding Breakthrough -- Triggers [Re: DavidC99]  
Joined: Dec 2010
Posts: 74
DavidC99 Offline
Junior Member
DavidC99  Offline
Junior Member

Joined: Dec 2010
Posts: 74
I have added new music to the mission. It works just fine. smile


DavidC99
#3163699 - 12/23/10 02:37 AM Re: Comanche Gold Modding Breakthrough -- Triggers [Re: DavidC99]  
Joined: Dec 2010
Posts: 74
DavidC99 Offline
Junior Member
DavidC99  Offline
Junior Member

Joined: Dec 2010
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
#3163815 - 12/23/10 08:05 AM Re: Comanche Gold Modding Breakthrough -- Triggers [Re: DavidC99]  
Joined: Mar 2008
Posts: 353
ufolev Offline
Member
ufolev  Offline
Member

Joined: Mar 2008
Posts: 353
Hi DC99

Let me test it please!


ufolev :-)

#3163819 - 12/23/10 08:31 AM Re: Comanche Gold Modding Breakthrough -- Triggers [Re: DavidC99]  
Joined: Dec 2010
Posts: 74
DavidC99 Offline
Junior Member
DavidC99  Offline
Junior Member

Joined: Dec 2010
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
#3163989 - 12/23/10 04:07 PM Re: Comanche Gold Modding Breakthrough -- Triggers [Re: DavidC99]  
Joined: Mar 2008
Posts: 353
ufolev Offline
Member
ufolev  Offline
Member

Joined: Mar 2008
Posts: 353
hi DC99,

I already sent PM with email.

I have 1 additional question:

Is it possible to increase the number of waypoints in CG mission editor
above the limit of 10 ?

ufolev

#3164063 - 12/23/10 06:05 PM Re: Comanche Gold Modding Breakthrough -- Triggers [Re: DavidC99]  
Joined: Dec 2010
Posts: 74
DavidC99 Offline
Junior Member
DavidC99  Offline
Junior Member

Joined: Dec 2010
Posts: 74
That's a good question. Waypoint data is stored in the .MIS file and the .JIM file. I believe the .JIM file contains waypoint data for the briefing map, but the .MIS file contains data for the in-game mission. I was able to add waypoints manually in the .MIS file, but I couldn't get beyond ten.

If you're looking to use them as regular waypoints, it doesn't seem possible (yet, anyway). If you are looking to use them as triggers for when the player gets near to them, you can use NPC waypoints as triggers for the player, I believe, but I haven't tested it.


DavidC99
#3164418 - 12/24/10 01:02 AM Re: Comanche Gold Modding Breakthrough -- Triggers [Re: DavidC99]  
Joined: Dec 2010
Posts: 74
DavidC99 Offline
Junior Member
DavidC99  Offline
Junior Member

Joined: Dec 2010
Posts: 74
Creating a Radio Conversation:

Our goal will be to implement a number of triggers that will result in what sounds like a conversation between multiple parties at the start of a mission. Flyboy has lamented that the Editor doesn't allow for this feature. While it's true that the Editor doesn't explicitly allow it, it is entirely possible to add manually.

What you'll need:
  • A simple custom map exported to MRF format. It can even be empty for this example, except for the player.
  • An understanding of how to pack and unpack a .PFF/MRF file. A .PFF/MRF viewer such as FwO Raven's pff utility is recommended if you don't have a preferred one.
Instructions:
  1. Extract USER.MIS from you MRF file and open it with a text editor.
  2. Find the following line. After it marks where triggers begin:
    Code:
    <<	;wp end
  3. Find the following lines. Prior to them is where triggers end:
    Code:
    <
    ;---------> Data ENDS <----------
  4. Make the following changes so your file looks something like this:
    Code:
    <<	;wp end
    if
    time, 2
    then
    pend, 2BAS002.wav, 0
    
    if
    time, 2
    then
    pend, CPLT722.wav, 2
    
    if
    time, 2
    then
    pend, CPLT569.wav, 0
    
    if
    time, 2
    then
    pend, WING003.wav, 1
    
    if
    time, 2
    then
    pend, WING506.wav, 0
    <
    ;---------> Data ENDS <----------
  5. Place USER.MIS back into your MRF file.
  6. Load the mission normally and verify that when the mission starts up, after a few seconds, you'll hear what sounds like dynamic radio chatter for that mission. If it didn't work, go back over each step.
Explanation and Conclusion:
  • pend means to place a sound file in a queue and play it when it is able.
  • The first argument given to pend is the sound file.
  • The second argument appears to be a delay. This delay would serve to make conversations sound more natural, depending on how calm or frantic the speaker is, etc. etc..
  • When the conditions are the same in two triggers that want to pend sound files, sounds appear to be queued in order of appearance of their triggers in the MIS file. In other words, the trigger that appears first gets its sound file added first.
Other possibilities
  • Some interesting conversations could be played based on this by using the right order of sounds.
  • Of note, sound files need not be stock files. They can be custom wav files.


DavidC99
#3164684 - 12/24/10 01:18 PM Re: Comanche Gold Modding Breakthrough -- Triggers [Re: DavidC99]  
Joined: Nov 2006
Posts: 3,453
Flyboy Offline
Senior Member
Flyboy  Offline
Senior Member

Joined: Nov 2006
Posts: 3,453
England, UK
Jeez, DavidC99 - for a newcomer you have certainly a lot to offer for the Comanche Gold community - as small as it is. It looks like you've made more breakthroughs in the last week or so than has been made by anyone in the past 10 years. It's a shame though, that so much research and work has had to be done JUST to make missions on par with the original game ones, due to the editor leaving out certain important feature implementation.

Well done, sir!

#3164916 - 12/24/10 07:33 PM Re: Comanche Gold Modding Breakthrough -- Triggers [Re: DavidC99]  
Joined: Dec 2010
Posts: 74
DavidC99 Offline
Junior Member
DavidC99  Offline
Junior Member

Joined: Dec 2010
Posts: 74
Thank you, sir. smile

Incidentally, if you guys are any good with art, you might be able to make new maps -- not missions, but maps. The map formats are in a number of .pcx files (old school picture format), but I haven't been able to open them, yet, with any viewers. The idea is that you provide picture representations of a color map, an elevation map, etc. etc.. The type of representation and the color tell the game what you want done. When you're finished with all of the pictures, you have your map. (Yes, it's more complicated than this, but it might be entirely possible.)

I have started work on expanding my Bunker Bashout mission to a seven mission campaign, complete with each mission being full of triggers and new features. Some features, I suspect, will not have been implemented this way in any campaign or mission for CG to date. I hope to complete this in record time.


DavidC99
#3165001 - 12/24/10 09:18 PM Re: Comanche Gold Modding Breakthrough -- Triggers [Re: DavidC99]  
Joined: Mar 2008
Posts: 353
ufolev Offline
Member
ufolev  Offline
Member

Joined: Mar 2008
Posts: 353
With your new custom campaign with such high quality Comanche Gold
have no choice except to become Comanche Platinum !

:-)

Last edited by ufolev; 12/24/10 09:38 PM.
#3165359 - 12/25/10 12:21 PM Re: Comanche Gold Modding Breakthrough -- Triggers [Re: DavidC99]  
Joined: Nov 2006
Posts: 3,453
Flyboy Offline
Senior Member
Flyboy  Offline
Senior Member

Joined: Nov 2006
Posts: 3,453
England, UK
As Kid Rock would say, "We're goin' Plat'num!"

#3165484 - 12/25/10 05:51 PM Re: Comanche Gold Modding Breakthrough -- Triggers [Re: DavidC99]  
Joined: Dec 2010
Posts: 74
DavidC99 Offline
Junior Member
DavidC99  Offline
Junior Member

Joined: Dec 2010
Posts: 74
I would say we're heading toward 24kt gold. wink

Platinum would have to be a number of new campaigns, resolutions, better gameplay, details, an entire scripting language behind it, etc. etc.. Essentially what Comanche 4 should have been. biggrin


DavidC99
#3166662 - 12/27/10 08:43 PM Re: Comanche Gold Modding Breakthrough -- Triggers [Re: DavidC99]  
Joined: Dec 2010
Posts: 74
DavidC99 Offline
Junior Member
DavidC99  Offline
Junior Member

Joined: Dec 2010
Posts: 74
Hmm, I examined melee maps, and it looks like we might be able to make our own with some effort -- maybe even with some triggers to make it interesting.

  • Imagine fighting over an area with stingers and SAMs scattered all over the place taking shots at us.
  • Maybe instead of fighting to the death, we could compete against each other to destroy a target or group of targets first. (Then again, isn't this what Comanche Gold calls coop? wink )
  • We could even do a race map. First one to make it over the SAM field to a specific waypoint wins.
Yeah, I know. Crazy stuff, but it looks like it might be possible. biggrin

It's amazing how many features they left out of the editor. In fact, I'm working on the second map of my campaign, and while some may appreciate the triggers, the third one should introduce a very simple but new feature not used before if all goes well.


DavidC99
#3167002 - 12/28/10 12:26 PM Re: Comanche Gold Modding Breakthrough -- Triggers [Re: DavidC99]  
Joined: Nov 2006
Posts: 3,453
Flyboy Offline
Senior Member
Flyboy  Offline
Senior Member

Joined: Nov 2006
Posts: 3,453
England, UK
It's funny you should bring this up, only the other night I had the idea of perhaps being able to put AI units into melee maps to make it more 'interesting'. Imagine having to keep a eye out for human players AND AI units? Also, would it be possible to add AI-controlled Comanche's? That would really confuse players!

Comanche Racing has previously been tried, and is documented at this site here:
http://www.monsta.cc/Comanche/cockpit.htm#cr

Page 1 of 2 1 2

Moderated by  RacerGT 

Quick Search
Recent Articles
Support SimHQ

If you shop on Amazon use this Amazon link to support SimHQ
.
Social


Recent Topics
Carnival Cruise Ship Fire....... Again
by F4UDash4. 03/26/24 05:58 PM
Baltimore Bridge Collapse
by F4UDash4. 03/26/24 05:51 PM
The Oldest WWII Veterans
by F4UDash4. 03/24/24 09:21 PM
They got fired after this.
by Wigean. 03/20/24 08:19 PM
Grown ups joke time
by NoFlyBoy. 03/18/24 10:34 PM
Anyone Heard from Nimits?
by F4UDash4. 03/18/24 10:01 PM
RIP Gemini/Apollo astronaut Tom Stafford
by semmern. 03/18/24 02:14 PM
10 years after 3/8/2014
by NoFlyBoy. 03/17/24 10:25 AM
Copyright 1997-2016, SimHQ Inc. All Rights Reserved.

Powered by UBB.threads™ PHP Forum Software 7.6.0