Multiple capturable objectives


(FrostyChilli) #1

Hello!

My situation is this:

I have 3 planes. All need refilling. All require 1 fuel can. You also have to deliver the documents to only 1 of the planes. We have:

3 planes
3 fuel cans
1 set of documents

Around each plane I have 2 different "trigger_flagonly_multiple"s. 1 is for documents and 1 is for fuel.
So 6 triggers. If document flag trigger is activated, all other document flag triggers get removed(3 triggers at the same time) from all planes. If a fuel can trigger is activated, only 1 trigger(around that certain plane) is removed. The problem is that it doesn’t matter if I bring fuel or documents to the “document” trigger or “fuel trigger”. These triggers seem to react to EVERY capturable object.

My question. Is there a way to make “team_CTF_red/blueFlag” to trigger only certain "trigger_flagonly_multiple"s ? So that my Document object would not trigger “fuel triggers”.

I tried adding “target/targetname” combination but it didn’t work. Is there a way to set keys? Because what I noticed in “trigger_flagonly_multiple” entitie’s option, it is said that: “Player must be carrying the proper flag for it to trigger.”. Is there a way to SET that proper flag?

Thank you!
Cheers,
Frosty


(Loffy) #2

I do not think so, sorry. I might be wrong ofc.

The alternative is to have the players deliver the fuel first, then the document (or vice versa). But you knew that. It’s much cooler if the team could steal and deliver these things independently of each other.

On a sidenote: another “problem” is that the player who is carrying a flag cannot pass through a trigger_flagonly_multiple and continue with the flag. The flag is ripped from his hands once he steps into the first trigger. This is un-cool because I would like to have trigger_flagonly_multiples in my map that triggers graphical/sound effects to provide clues to the enemy team: “Flag Carrier is in the Basement!”, for example. Well, there might be a smart way to solve this.


(FrostyChilli) #3

Not glad to hear. :confused:

I haven’t thought about it but it might be possible(with my problem) to activate and deactivate triggers within Flag captured and stolen script parts. If for example documents get stolen then the fuel spot, which was deactivated the moment I touched it while carrying a flag, could be reactivated again in the Documents “final stolen” script part. I see this as the only solution atm. I might be over looking something but we’ll see. I’ll look into it later.

Cheers,
Frosty!


(twt_thunder) #4

connect the "trigger_flagonly_multiple to the right scriptnames and they “should” activate “death part” of script… I think


(Mateos) #5

trigger_flagonly should be enough btw if it’s a single team obj?

An alternative would be to disable the drop off triggers after an obj get stolen, but that would force to secure the first stolen obj even if the second is also stolen…

If a trigger_multiple could let check the player to see if he has the flag, it would solve the thingy ^^’


(FrostyChilli) #6

@thunder_13th What do you mean? They Do activate “death” part no matter what flag you bring there. And there is the problem. I have 4 “flags” to deliver. 1 is different from other 3. I need 2 triggers. 1 that triggers only after you enter with 1 kind of flag and other that triggers only with 3 other flags. Right now it doesn’t matter which flag enters the trigger.

@Mateos Disabling triggers does not work. I mean yeah, that is what I am doing right now. If a fuel canister is brought to plane then that trigger at plane gets deleted. But the problem is this: There are 2 trigger areas around the plane. 1 for documents and 1 for fuel. That is atleast how I want it to be. But right now this scenario is possible: Bring 1 fuel to first plane> 1 trigger area disappears, 1 is left around that same plane. > Bring 2nd fuel canister to the same plane > Second trigger area vanishes. And that is the problem. It shouldn’t be possible to bring more than 1 canisters to 1 plane. Now from other planes the document trigger area vanishes as well. There are 3 document trigger areas with same script names. So if 1 vanishes, all others vanish. Now what we have left: 2 planes, 2 flag_only triggers( for fuel ), 1 fuel canister, 1 set of documents. I bring fuel to 2nd plane, it is refilled. Now I have 1 trigger, 1 plane, 1 set of documents. However this plane has not been filled with fuel. Now I bring documents to this last plane > Game is won even though I brought 2 fuel canisters to 1 plane and 0 to last one.


(twt_thunder) #7

give the objectives own targetname and script, try to connect then the propper delivery place to the same script… havent tested this myself yet its just an idea

EDIT: I will do a teest myself, if I get to work I will attach the map and script here for you to see what I mean, but not sure if it works…

but it says:

Player must be carrying the proper flag for it to trigger.
It will call the “death” function in the object’s script.


(twt_thunder) #8

No you’re right the flag stuff in ET doesnt work propperly even with a targename on objective… we need a flagonly_objname in et :slight_smile:


(twt_thunder) #9

this actually bugs me… is this something hardcoded in game or is it a def file and a gtk thing that could be done?


(ailmanki) #10

Not sure about this idea. It should be possible to detect which flag got delivered; despite any flag triggering the death event,
So you have multiple flags, each with its own Scriptname and script associated. Then you have the various capture areas.
Now since any capture area will remove the flag from the player (as far as I understood) - you will want only one capture area per plane, and detect which flag got delivered. Second since you got fuel and document; you will need a msg “Plane already got refueled - take that fuel elsewhere” And have it appear in front of the plane or somewhere.

With this “setup” it works like this: Player gets fuel delivers at plane. You get 2 script events, the death from capture area and trigger captured from the fuel. So you need to add a wait to the death and set some accum from captured trigger. This way you can know which item got delivered in the death event. As long as the captured event is properly called this should work fine.
On second fuel deliver you will detect that the plane already is refueled, call that msg, and make it reappear somewhere near the plane.
If its the documents you will also know it, and yay - end the game.
Well its not perfect, since you can still “deliver the fuel to wrong place” but if you make the map narrative good enough - I guess no one will notice.

This is just an idea, I have not tried it, but as long as the triggers get called as supposed, this idea should work fine.


(FrostyChilli) #11

@thunder_13th: It is annoying yeah. But I have no idea which it is.

@ailmanki: But 1 capture area won’t be enough because: You deliver 1 fuel to plane. “capture area trigger” gets deleted and now there is a trigger area, which tells you that plane is refilled. Now everything is fine if you approach the plane with the second canister. There are no more “capture trigger areas” and there is a trigger that just tells you “Hey! Plane is refilled, find another plane.”. But if there is no capture area this means you can’t bring the documents there either.

If its the documents you will also know it, and yay - end the game.

This is the problem because the only way to know it is if there is a “trigger_flagonly_multple”. There is no other way to detect the flag in my opinion. And this suggests you need 2 trigger areas around 1 plane as long as documents are not delivered. This again opens the opportunity to bring 2 fuel canisters to 1 plane.


(ailmanki) #12

Thing is you need to detect if fuel or document got delivered. And I think that is possible. And based on that write the script.
Overall I don’t like the idea of being able to deliver at multiple spots, players also don’t know which objective they are carrying, unless they saw it. Everyone else will just see objective symbol above there head.


(Mateos) #13

Each have their own entities in the editor, thus a different scriptname/targetname. And thus each have a secured event :slight_smile:

Problem is secured and death events are called at once, no time to check. Or maybe the death event of trigger_flagonly_multiple calls the secure event of the related flag, in which case we can do nothing (and I think this is how it work, seems more logic than the other way round); Can be checked by putting wm_announce in each parts and see in which order they’re printed.


(stealth6) #14

So if I understand correctly we have following things to work with:

  • Can detect death of each fuel cell
  • Can detect death (secured event) of each secure point
  • Don’t know if death of fuel cell or secure point is triggered first

Maybe try following scenario:
Each plane has 1 secure area (trigger_flagonly_multiple)

In the death of fuel 1:

  • accum 4 set 1 // which fuel cell?
  • accum 6 inc 1
  • trigger check_planes

In the death of fuel 2:

  • accum 4 set 2
  • accum 6 inc 1
  • trigger check_planes

In secure event of plane 1:

  • accum 5 set 1 // which plane?
  • accum 6 inc 1
  • trigger check_planes

In secure event of plane 2:

  • accum 5 set 2
  • accum 6 inc 1
  • trigger check_planes

In function check_planes:

  • accum 6 abort_if_not_equal 2 // fuel death & secure point must be triggered first
  • accum 6 set 0
  • accum 5 trigger_if_equal 1 check_plane_1
  • accum 5 trigger_if_equal 2 check_plane_2
  • accum 5 trigger_if_equal 3 check_plane_3
  • accum 5 set 0

In function check_plane_1:

  • accum 1 trigger_if_equal 1 respawn_fuel // plane already has fuel
  • accum 1 abort_if_equal 1
  • accum 1 inc 1

check_plane_2 - accum 2

check_plane_3 - accum 3

In function respawn_fuel

  • accum 4 trigger_if_equal 1 respawn_fuel_1
  • accum 4 trigger_if_equal 2 respawn_fuel_2
  • accum 4 trigger_if_equal 3 respawn_fuel_3
  • accum 4 set 0

In function respawn_fuel_1

  • say: you’ve already delivered fuel
  • respawn fuel 1

If player secures docs than add 2 to the right accum. If accum 1 is 3 then planes has both docs & fuel. (or accum 2 or 3). Does this sound kind of right? Do we know which trigger_flagonly_multiple has been triggered or do we need to figure that out too?

Tell me if I missed something since I did this quickly.


(Mateos) #15

accum 6 can be raised by either both planes or one plane and the docs :confused: Death and Secure being called somehow at the same time, you’ll have a inc 2 on each secure event too… I think?


(stealth6) #16

Well there would be a very short amount of time that accum 6 has a value, but I guess theoretically it’s possible.
I think you can get around that by giving each trigger & each fuel a separate accum, but it makes the script much more complicated.


(FrostyChilli) #17

@stealth6

This works, yes. It does solve the problem of bringing 2 fuel cans to same plane. However there is still 1 problem. As I understand it works like this:

  1. Bring fuel to plane
  2. Remove fuel from player
  3. If: plane is not refilled, refill plane, else: respawn fuel
    However it means that if player delivers fuel to a plane that has already been refilled, the game removes fuel from player and tells him to walk back to the place where you can get the fuel and bring it to one of the other planes. This is bad and ruins the gameplay. However this is probably as close as we can get.

I think my only chances to get things working are to just change the gameplay. Either just have 1 plane where you have to deliver the docs and fuel or make it the way that fuel and documents have to be delivered to exactly the same spot. Or make players unable to deliver fuel before documents have been secured(not granting access to fuel). Because things seem to get really messy if you try to bring 2 different objects to different spots, if at the same time you have to make sure that 1 type of object is brought to only 1 location each.

EDIT: Can you guys perhaps name me maps where you have to bring 2 different objectives to 2 different locations. The only one I came up with right now is Dubrovnik where you have to deliver a key card to get access to church and thus to gold. And gold to boat to win the game. However I tried testing it the opposite way. I noclipped into the church, took the gold, brought gold to generator(where you have to bring the keycard) and as expected, generator trigger area accepted gold. Next I took the keycard and delivered it on the boat and as expected it worked also. I’m just thinking that maybe there is a map, which functions like I need it to function and has something special that we have missed.


(Mateos) #18

About 3), just disable the trigger_flagonly_multiple at which it has been secured.


(stealth6) #19

That’s right, but if there is a visual que to show the player that fuel has already been delivered then hopefully they’ll take it to another plane :smiley:

Ofc it also depends how close together these planes are. They might walk through the trigger to get to another plane which will be frustrating.

EDIT: [QUOTE=Mateos;512428]About 3), just disable the trigger_flagonly_multiple at which it has been secured.[/QUOTE]

Then they can’t secure the docs?


(FrostyChilli) #20

@Mateos What stealth said…

@stealth6 I thought about it, yes. And it seems as one of the few possibilities. 1 way or another I’ll make this whole system work so that gameplay won’t be changed much.