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

#3167293 - 12/28/10 09:22 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
The difference is that we might be able to do some of these things by adding new units, waypoints, and triggers. wink

Not sure if we can get 2-7's out there in melee maps. I know 2-7 isn't spawned when he's placed in coop maps, but he may be left alone on melee maps. Would be wild if we all had 2-7's at the start. biggrin


DavidC99
#3168816 - 12/31/10 09:14 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
Timers / Counters

By now I'll assume that extraction and repacking of map files are basic knowledge (although it's not always that easy).

Let's say we want a custom sound to play when the player passes a waypoint. Let's also say that five seconds after the player passes the waypoint, we want him to receive a text radio message. First we play the sound file as already demonstrated:

Code:
if
waypoint, P, A1
then
pend, cust11.wav, 0


You'll have to replace cust11.wav with the name of your custom sound file.

Now we need some way of keeping track of time based on this trigger. Therefore, we add the following trigger next:

Code:
if
waypoint, P, A1
then
clearcounter


This sets up a timer when the player crosses Waypoint 1. Now we need to use the timer, so we write a third trigger:

Code:
if
waypoint, P, A1
and
counter, 5
then
text, 1


Remember to have your radio message, RM01, defined in the .INF file (as shown previously) or else this won't display.

This checks that the player has already passed Waypoint 1, and it checks the value of the counter. Five seconds would have had to go by before this trigger's payload is carried out, if all went well.

ufolev, since you're working on maps, let me know if you have any trigger ideas or questions about them. In fact, if you want some simple triggers cooked up for you, I might be able to help out.


DavidC99
#3168827 - 12/31/10 10:08 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 Davi,

After your appearance as mission maker I understood how limited are my
knowledges :-(
But I will be happy if I learn from your suggestions above how to put
some simpliest event trigger in my mission and this will be enough to me.

ufo :-)

#3168856 - 12/31/10 11:33 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
If you change your mind and want more complex triggers written, let me know. I'd be happy to try to help.


DavidC99
#3170575 - 01/03/11 10: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
By request...

Tracking

This will show how to cause enemy units to track the player.

Let's say that after the player crosses Waypoint 3, we want an enemy group of Hokums to track the player's movements.

Code:
if
waypoint, P, A3
then
route, H, WP


This is all there is to the trigger itself. It checks if group P, the player, has crossed waypoint 3. If he has, then the group H is routed to the player's location. Route is also used to route units to waypoints. If we wanted them to go to waypoint 3 instead, we could have easily done this:

Code:
if
waypoint, P, A3
then
route, H, A3


Unfortunately, Novalogic ripped out the option to group units in the editor. This means, by default, the game won't know who you mean by specifying group H. There are a few ways around this:

  1. Either use the Goal checkboxes in the mission editor to make your own limited groupings;
  2. Hex edit the .POS file to change the object's group ID;
  3. Or else use a program to edit the .POS file and allow you to change the group ID.
The first option is sufficient if you have one group to make and you don't want complicated triggers. By designating something as an enemy goal, it is given a group ID of E. By making something a goal for the player, it is given a group ID of G. If both are used, the mission editor writes triggers automatically to win if G is destroy and lose if E is destroyed.

This can be changed by the modder by simply editing the triggers in the .MIS file. Thus, you can actually make group E a group of enemy Hokums by selecting them all as enemy goals. Then delete the default trigger for group E, which should look like this:

Code:
if
destroyed, E
then
lose


Substitute it with something like this:

Code:
if
waypoint, P, A3
then
route, E, WP


The second option, the one involving hex editing, is fine for a simple switch, but is tedious and not the way to go for a real mission which involves complicated groupings.

The third option is the preferred method. I have a custom program I've written that can group units, but it's not complete and requires some manual effort to figure out what object is what. I plan on releasing something to the public once I make it easier to use (and even then it won't be super easy). In the meantime, if someone wishes for me to group something for them before I'm done (which should hopefully be soon -- like hopefully by the weekend), I'd definitely consider doing it for them.


DavidC99
#3173652 - 01/07/11 04:44 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 have not completed the tool, yet, and I'll need some time to come up with a straightforward design. So far, when completed, it should allow you to alter the following for each object:
  • Group IDs.
  • Team/Side.
Deloros' idea of placing other objects in custom missions which the editor doesn't support is entirely possible. I invented Super 2-7, a highly armored version of the normal 2-7, except I made it so that we don't get along. You can see 2-7, a Frogfoot, and me, all engaged in a free-for-all. Yes, a free-for-all! wink



Although not entirely related, the following is a screenshot of me firing loads of hellfire missiles at Super 2-7 in what appears to be bullet time. biggrin



Custom missions should get a whole lot more interesting if people can take the time to make them.


DavidC99
#3173726 - 01/07/11 08:18 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
Hello David,

Will Your new tool for mission editing be separated from the Original Mission Editor
or it will be some kind of Moded Super Mission Editor ?

ufo ?

#3173739 - 01/07/11 09:00 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
It would be separate from the mission editor. The way it would work is by analyzing, providing you with the list of objects in your mission, allowing you to make changes to these object properties, and then editing (or even patching, if you will) the exported custom mission file(s) in question. The editing is actually not that difficult. The triggers are actually harder to write once you get used to it. smile As soon as you repack the patched file(s) back into your PFF/MRF, you're good to go.

In theory, we might be able to make our own mission editor. It's certainly possible, and I already have a general idea of what it would take, but it's still a lot of work. If we had a volunteer who could handle the graphical user interface, I'd consider working on a backend for it.


DavidC99
#3175309 - 01/09/11 02:26 PM Re: Comanche Gold Modding Breakthrough -- Triggers [Re: DavidC99]  
Joined: Jan 2011
Posts: 2
RobDog Offline
Junior Member
RobDog  Offline
Junior Member

Joined: Jan 2011
Posts: 2
Tampa Bay Area / Florida / USA
DavidC99,

Had a great time in Co-op last night with you and fly. I'll look over this existing information and tools and get up to speed before moving forward with what we were discussing.

Thanks for all the hard work on this,
Rob

#3175499 - 01/09/11 07:22 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 had fun, too, and your plan to look over everything sounds great. I've finished the tool mentioned above, but it's being tested by someone. I think what we discussed may still be the route to go, however.

Unfortunately, there are still things regarding the editor and mission files about which I'm still unsure. The main things I'd like to learn right now are:
  • The rest of the .pff file format. I have the basics, but there are still some bytes of which I'm unsure.
  • JIM files. Lots to learn on those.
  • How objects know which entries in the AI list are the ones to use for when they die. We'd need this to build the AI list properly. (Of note, while the regular missions appear properly done, the mission editor that we use creates duplicate entries in an inefficient manner. Go figure.)
After I have all of this, it appears I may actually be able to do a huge portion of the project.


DavidC99
#3176685 - 01/11/11 08:13 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
Trigger reference material. Note: All information may not be accurate; this contains some guesses. It's also not complete.
  • Conditional beginning:
    • IF: Marks the start of a trigger.
  • Binary operators:
    • AND: Both conditions must be true.
    • OR: One condition must be true.
    • NOR:Both conditions must be both false.
    • NAND:Both conditions cannot be both true.
    • ORN: Same as NOR.
    • ANDN: Same as NAND.
  • Conditional consequence:
    • THEN: Marks the end of the test condition and the beginning of the command.
  • Event Tests:
    • SPEE: Speed. Measures player speed against a number.
    • TAIR: Checks if player is targeting friendly air unit.
    • TGND: Checks if player is targeting friendly ground unit.
    • GEAR:True if player's gear is down
    • FACE: True if facing a direction or waypoint
    • NOTF: NOT facing a direction or waypoint
    • NEAR:Nearer. Measures if the player is nearer to the supplied waypoint than the supplied distance.
    • FART:Farther. See NEAR.
    • ABOV:Above. Checks if player is above supplied height.
    • BELO:Below. Checks if player is below specified height.
    • ROCK:Rockets. Compares amount of available player's rockets to supplied number.
    • WEAP:Weapon. This compares a specified number against the player's current weapon index.
    • ARTI:Artillery. Compares amount of player's available artillery calls to supplied number.
    • DAMA:Damage/Damaged. Checks if damage has exceeded a supplied number.
    • HELL:Hellfires. Compares amount of player's available hellfires to a supplied number.
    • STIN:Stingers. Compares amount of player's available stingers to a supplied number.
    • WING: True if player sent a numbered message (ie. one of the M commands) to the wingman.
    • TIME: Compares supplied number to time since mission started.
    • COUN:Counter: Compares counter to supplied number to see if a certain amount of seconds has passed.
    • ALIV:Alive. Tests if supplied object group is alive.
    • INTA:Intact. Tests if supplied object group is intact.
    • KILL:Killed. Tests if supplied object group has had a certain number of members killed.
    • ATTA:Attacked: Checks to see if supplied group has been attacked.
    • DEST: Destroyed. Checks if supplied group has been destroyed.
    • SEES:Tests to see if one unit has established visual contact.
    • ENCO:Encounter. Checks to see if a member of group one has established a lock on a member of group two.
    • WAYP:Checks if member of supplied group has crossed the supplied waypoint.
  • Commands:
    • WIN: This forces the game to end in a win
    • FLAS:Flash. This causes specified parts of the HUD to flash.
    • END: This causes the game to end with no win or loss.
    • ROUT:Routes AI either to a waypoint or to a group (which may even be on the move).
    • TEXT: Writes an indexed text message from the INF file.
    • PLAY:Plays a sound file.
    • PEND: Places a sound file into a queue and plays it when available after the given delay.
    • SOUA:Squak. Has to do with playing audio. Appears to be a synonym of PEND, but it may be private to own channel. (ie, in multiplayer only the local player who triggered it hears it, such as when exceeding air speed)
    • LOSE: Forces game to end in a loss.
    • ELIM:Eliminate. Possible synonym for VAPO.
    • VAPO:Vaporize. Kills a group dead instantly.
    • SETA:setai. Gives AI orders based on a number. Format unknown at present.
    • CLEA:clearcounter. Resets the counter, which acts as a timer for triggers.
    • ALER:Alert/Alerted. Unknown.
Examples might possibly follow later if anyone is interested. Please let me know if there are any errors or corrections to make.


DavidC99
#3285863 - 05/03/11 09:16 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
First I want to say Thank You DavidC99
for all patience to explain the triggers
with simple words

I want to give a positive feedback
because I included 2 simple triggers
in my last Comanche Gold custom
mission "SLAVES"

I used them to situate a negative
outcome options.


Now I am more encouraged to use other kind of described triggers :-)

ufo :-)

#3292624 - 05/11/11 10:09 PM Re: Comanche Gold Modding Breakthrough -- Triggers [Re: ufolev]  
Joined: Mar 2008
Posts: 353
ufolev Offline
Member
ufolev  Offline
Member

Joined: Mar 2008
Posts: 353
There is other waypoint trigger
used to situate win option in
the Comanche Gold custom mission
"CONTACT"


ufo :-)

#3528431 - 02/29/12 05:31 AM Re: Comanche Gold Modding Breakthrough -- Triggers [Re: ufolev]  
Joined: Mar 2008
Posts: 353
ufolev Offline
Member
ufolev  Offline
Member

Joined: Mar 2008
Posts: 353
2 new and different kind of triggers are used in the Comanche Gold custom mission "DEAD OR ALIVE"
- the first is an area trigger when the player passes wpt1 2 blackhawks are redirected to follow him constantly,



- the second is an area and time trigger when the player passes wpt 5 it starts time counting and gives
a radio conversation messages.



many thanks to DavidC99

ufo :-)

Last edited by ufolev; 02/29/12 05:36 AM.
#3642506 - 09/11/12 08:40 PM Re: Comanche Gold Modding Breakthrough -- Triggers [Re: ufolev]  
Joined: Mar 2008
Posts: 353
ufolev Offline
Member
ufolev  Offline
Member

Joined: Mar 2008
Posts: 353
In the custom mission MEDEVAC there are used all kinds of triggers, that I know till now

this is a good example of real complex trigger usage

in the left there are the commands /black colour text/
in the right the explanation of them /green colour text/


<< ;wp end

if if the player pass checkpoint A1 then start the timer
waypoint, P, A1
then
clearcounter

if
waypoint, P, A1 if the player pass checkpoint A1 and the timer counts 1 second
and then direct apache1 to chinook position
counter, 1
then
route, W, WX

if
waypoint, P, A1 if the player pass checkpoint A1 and the timer counts 2 seconds
and then direct apache2 to chinook position
counter, 2
then
route, R, WX

if if the player pass checkpoint A1 and the timer counts 10 seconds
waypoint, P, A1 then direct chinook to checkpoint A2
and
counter, 10
then
route, X, A2

if
waypoint, P, A1 if the player pass checkpoint A1 and the timer counts 4 seconds
and then direct blackhawk to the wingman position
counter, 4
then
route, E, WU

if
waypoint, X, A2 if chinook pass checkpoint A2 then direct chinook to
then checkpoint A3
route, X, A3

if if chinook pass checkpoint A3 then direct chinook to
waypoint, X, A3 checkpoint A4
then
route, X, A4

if if chinook pass checkpoint A4 then restart the timer
waypoint, X, A4
then
clearcounter

if if chinook pass checkpoint A4 and the timer counts 1 second
waypoint, X, A4 then direct chinook to the M1A1 position
and
counter, 1
then
route, X, WY

if if chinook pass checkpoint A4 and the timer counts 2 seconds
waypoint, X, A4 then direct apache1 to the M1A1 position
and
counter, 2
then
route, W, WY

if if chinook pass checkpoint A4 and the timer counts 3 seconds
waypoint, X, A4 then direct apache2 to the M1A1 position
and
counter, 3
then
route, R, WY

if if chinook pass checkpoint A4 and the timer counts 4 seconds
waypoint, X, A4 then direct blackhawk to the M1A1 position
and
counter, 4
then
route, E, WY

if if chinook pass checkpoint A4 and the timer counts 20 seconds
waypoint, X, A4 then show text radio message "CP4 repair team deployed"
and
counter, 20
then
text, 1

if if chinook pass checkpoint A4 and the timer counts 21 seconds
waypoint, X, A4 then play voice radio message "CP4 the repair team is on the
and ground"
counter, 21
then
play, cp401.wav


if if chinook pass checkpoint A4 and the timer counts 120 seconds
waypoint, X, A4 then show text radio message "CP4 repair team on board"
and
counter, 120
then
text, 2


if if chinook pass checkpoint A4 and the timer counts 121 seconds
waypoint, X, A4 then play voice radio message "CP4 the repair team is on board"
and
counter, 121
then
play, cp402.wav


if if chinook pass checkpoint A4 and the timer counts 180 seconds
waypoint, X, A4 then direct blackhawk to checkpoint A5
and
counter, 180
then
route, E, A5


if if player pass checkpoint A5 then direct M1A1 to checkpoint B1
waypoint, P, A5
then
route, Y, B1


if if werewolf team pass checkpoint C5 then direct werewolf team
waypoint, T, C5 to the player position
then
route, T, WP


if if M1A1 pass checkpoint B1 then direct M1A1 to checkpoint B2
waypoint, Y, B1
then
route, Y, B2


if if M1A1 pass checkpoint B2 then direct M1A1 to checkpoint B3
waypoint, Y, B2
then
route, Y, B3


if if M1A1 pass checkpoint B3 then direct M1A1 to checkpoint B4
waypoint, Y, B3
then
route, Y, B4


if if M1A1 pass checkpoint B4 then direct M1A1 to checkpoint B5
waypoint, Y, B4
then
route, Y, B5


if if M1A1 pass checkpoint B5 then direct M1A1 to checkpoint B6
waypoint, Y, B5
then
route, Y, B6

if if M1A1 pass checkpoint B6 then direct M1A1 to checkpoint B7
waypoint, Y, B6
then
route, Y, B7


if if M1A1 pass checkpoint B7 then direct M1A1 to checkpoint B8
waypoint, Y, B7
then
route, Y, B8


if if M1A1 pass checkpoint B8 then direct M1A1 to checkpoint B9
waypoint, Y, B8
then
route, Y, B9


if if M1A1 pass checkpoint B9 then direct M1A1 to checkpoint B10
waypoint, Y, B9
then
route, Y, B10


if if blackhawk pass checkpoint A5 then restart the timer
waypoint, E, A5
then
clearcounter


if if blackhawk pass checkpoint A5 and the timer counts 1 second
waypoint, E, A5 then direct blackhawk to the hostage house position
and
counter, 1
then
route, E, WS


if if blackhawk pass checkpoint A5 and the timer counts 2 seconds
waypoint, E, A5 then show text radio message "CP5 protect evacuation point"
and
counter, 2
then
text, 3


if if blackhawk pass checkpoint A5 and the timer counts 3 seconds
waypoint, E, A5 then play voice radio message "CP5 protect the evacuation point"
and
counter, 3
then
play, cp501.wav


if if blackhawk pass checkpoint A5 and the timer counts 45 seconds
waypoint, E, A5 then show text radio message "CP5 the crew on board. RTB"
and
counter, 45
then
text, 4


if if blackhawk pass checkpoint A5 and the timer counts 46 seconds
waypoint, E, A5 then play voice radio message "CP5 the crew is evacuated"
and
counter, 46
then
play, cp502.wav


if if blackhawk pass checkpoint A5 and the timer counts 47 seconds
waypoint, E, A5 then direct blackhawk to checkpoint A6
and
counter, 47
then
route, E, A6


if if werewolf team is destroyed then direct hind team to the
destroyed, T blackhawk position
then
route, V, WE


if if blackhawk pass checkpoint A6 then restart the timer
waypoint, E, A6
then
clearcounter


if if blackhawk pass checkpoint A6 and the timer counts 1 second
waypoint, E, A6 then direct frogfoot to checkpoint D1
and
counter, 1
then
route, Z, D1


if if blackhawk pass checkpoint A6 and the timer counts 2 seconds
waypoint, E, A6 then show text radio message "apache/chinook team released"
and
counter, 2
then
text, 5


if if blackhawk pass checkpoint A6 and the timer counts 3 seconds
waypoint, E, A6 then direct blackhawk to checkpoint A7
and
counter, 3
then
route, E, A7


if if blackhawk pass checkpoint A6 and the timer counts 4 seconds
waypoint, E, A6 then direct chinook to checkpoint A7
and
counter, 4
then
route, X, A7


if if blackhawk pass checkpoint A6 and the timer counts 5 seconds
waypoint, E, A6 then play voice radio message " griffon2-6 1 frogfoot and 2 hinds are
and inbound your position"
counter, 5
then
play, cp60f.wav


if if frogfoot pass checkpoint D1 then direct frogfoot to checkpoint D2
waypoint, Z, D1
then
route, Z, D2


if if frogfoot pass checkpoint D2 then direct frogfoot to player position
waypoint, Z, D2
then
route, Z, WP


if if blackhawk pass checkpoint A7 then direct blackhawk to checkpoint A8
waypoint, E, A7
then
route, E, A8


if if blackhawk pass checkpoint A8 then the mission is accomplished
waypoint, E, A8
then
win


if if chinook or M1A1 or blackhawk is dead the mission is lost
destroyed, X
or
destroyed, Y
or
destroyed, E
then
lose

<
;---------> Data ENDS <----------




The creation of this mission was not possible without the help of DavidC99!

ufo :-)

Last edited by ufolev; 09/19/12 07:29 PM.
#3643605 - 09/13/12 03:57 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
jawdrop

#4332789 - 01/29/17 10:55 PM Re: Comanche Gold Modding Breakthrough -- Triggers [Re: DavidC99]  
Joined: Jan 2017
Posts: 24
FatCatProject Offline
Junior Member
FatCatProject  Offline
Junior Member

Joined: Jan 2017
Posts: 24
Originally Posted By: DavidC99
Trigger reference material. Note: All information may not be accurate; this contains some guesses. It's also not complete.

Hello !
Did you finish the editor you were talking about ? I still have many things to understand in the behaviour of the game, the midi, the mrf, but for the moment, I'm interested in Comanche "platinium" yep
And even if it's not ready, I would like to see what you learnt from those hexa files !

EDIT : I've found the tool in the Comanche Gold Map Exchange thread
EDIT : congratulation to flogger88's map exchange trick !

Last edited by FatCatProject; 01/30/17 12:00 AM.
#4333094 - 01/30/17 07:11 PM Re: Comanche Gold Modding Breakthrough -- Triggers [Re: FatCatProject]  
Joined: Mar 2008
Posts: 353
ufolev Offline
Member
ufolev  Offline
Member

Joined: Mar 2008
Posts: 353
Welcome FatCatProject,
It is a pity, but DavidC99 is not active in this forum long time ago.
I miss him, because everything that I have learned about custom mission creating comes from him.
But you can talk in the forum with the other man who knows everything about Comanche Gold - FLYBOY !
I will be happy to help too.
ufo :-)

Last edited by ufolev; 01/30/17 08:18 PM.
#4333879 - 02/02/17 12:27 AM Re: Comanche Gold Modding Breakthrough -- Triggers [Re: DavidC99]  
Joined: Jan 2017
Posts: 24
FatCatProject Offline
Junior Member
FatCatProject  Offline
Junior Member

Joined: Jan 2017
Posts: 24
Random experiments. I may edit this post in the future.

setai
***From Ghost Train Map :
train stops when setai set to 16 initially (and also 48), ... and starts at 0 initially (and also 32, 64,...)
attacked SA9 units switch to 0100 0001 which makes them able to attack.
attacked T80 units switch to 1011 0001.
Then... my theory about setai's 5 bit isn't verified anymore.


I'll suppose 8 bits for the moment.
so I guess each bit of setai seems to enable a different parameter in the ai. For instance, takeoff, movements, weapons, (weapon type?), quick aiming, quick fire, (limited ammunitions ?), 360 sight, etc.

  • SETAI parameters bit Number
    • 1 -
    • 2 -
    • 3 -
    • 4 -
    • 5 - Hypothesis movement allowed when set to 0 ?




Edit

objedit by DavidC99 works with data of objects, and each object is composed of 28 octets. You can set the camp with the second octet. I think that I can create a new obj'edit wink. Bits aren't that well aligned. As a result, you can't visualise it although it must be rather simple. I'm currently tweaking the objedit and the hexedit to know the behaviour better. That's all I know for the moment !
Edit :
Okay then, DavidC99's objedit editor is bugged. There is one bit that's used from team chooser that's affecting the group selector. But DavidC99's editor doesn't allow this kind of modifications, that's why reading you'll find team "1", "5" or else, that you won't be able to edit back to the user.POS

Last edited by FatCatProject; 02/07/17 11:28 PM.
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
Actors portraying British Prime Ministers
by Tarnsman. 04/24/24 01:11 AM
Roy Cross is 100 Years Old
by F4UDash4. 04/23/24 11:22 AM
Actors portraying US Presidents
by PanzerMeyer. 04/19/24 12:19 PM
Dickey Betts was 80
by Rick_Rawlings. 04/19/24 01:11 AM
Exodus
by RedOneAlpha. 04/18/24 05:46 PM
Grumman Wildcat unique landing gear
by Coot. 04/17/24 03:54 PM
Peter Higgs was 94
by Rick_Rawlings. 04/17/24 12:28 AM
Whitey Herzog was 92
by F4UDash4. 04/16/24 04:41 PM
Copyright 1997-2016, SimHQ Inc. All Rights Reserved.

Powered by UBB.threads™ PHP Forum Software 7.6.0