#3168816 - 12/31/10 09:14 AM
Re: Comanche Gold Modding Breakthrough -- Triggers
[Re: DavidC99]
|
Joined: Dec 2010
Posts: 74
DavidC99
Junior Member
|
Junior Member
Joined: Dec 2010
Posts: 74
|
Timers / CountersBy 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: 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: 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: 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
|
|
#3168856 - 12/31/10 11:33 AM
Re: Comanche Gold Modding Breakthrough -- Triggers
[Re: DavidC99]
|
Joined: Dec 2010
Posts: 74
DavidC99
Junior Member
|
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
Junior Member
|
Junior Member
Joined: Dec 2010
Posts: 74
|
By request... TrackingThis 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. 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: 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: - Either use the Goal checkboxes in the mission editor to make your own limited groupings;
- Hex edit the .POS file to change the object's group ID;
- 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: if
destroyed, E
then
lose Substitute it with something like this: 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
Junior Member
|
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: 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! 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. Custom missions should get a whole lot more interesting if people can take the time to make them.
DavidC99
|
|
#3173739 - 01/07/11 09:00 AM
Re: Comanche Gold Modding Breakthrough -- Triggers
[Re: DavidC99]
|
Joined: Dec 2010
Posts: 74
DavidC99
Junior Member
|
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. 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
|
|
#3175499 - 01/09/11 07:22 PM
Re: Comanche Gold Modding Breakthrough -- Triggers
[Re: DavidC99]
|
Joined: Dec 2010
Posts: 74
DavidC99
Junior Member
|
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
Junior Member
|
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
Member
|
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
Member
|
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
Member
|
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
Member
|
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
Senior Member
|
Senior Member
Joined: Nov 2006
Posts: 3,453
England, UK
|
|
|
#4332789 - 01/29/17 10:55 PM
Re: Comanche Gold Modding Breakthrough -- Triggers
[Re: DavidC99]
|
Joined: Jan 2017
Posts: 24
FatCatProject
Junior Member
|
Junior Member
Joined: Jan 2017
Posts: 24
|
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" 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
Member
|
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
Junior Member
|
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 . 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.
|
|
|
|