Need help on ammo trigger.

Newb Mapper

New Member
Reaction score
0
I've pretty much just started on maps a couple of months I've gotten a lot better with triggers I know how to do a lot of trigger but theres still a lot more I don't know how to do. One of these triggers happends to be an ammo trigger which what I mean is how to make your hero shoot and have ammo but when he runs out cant attack and has to use his knife because he doesnt have any ammo. Help would be much appreciated.
_____________________
Map(s) currently working on...
Resident evil 5:
Terrain-4%
Triggers-0%
Characters-0%
Skills-0%
Overall-1%

Orc Invasion:
Terrain-87%
Triggers-92%
Characters-100%
Skills-73%
Overall-88%
 

Tyrulan

Ultra Cool Member
Reaction score
37
You could do:

Unit has Ammo = true; EnableTrigger..(Shoot)
Unit has Ammo = false; DisableTrigger(Shoot)

Unit receives an item = ammo; turn on trigger(Shoot)

Plenty of solutions to this problem.
 

Newb Mapper

New Member
Reaction score
0
Yes but I also want their ammo to appear in the lumber so when they shoot there lumber A.K.A ammo will deplete
_____________________
Map(s) currently working on...
Resident evil 5:
Terrain-4%
Triggers-0%
Characters-0%
Skills-0%
Overall-1%

Orc Invasion:
Terrain-87%
Triggers-92%
Characters-100%
Skills-73%
Overall-88%
 

Tyrulan

Ultra Cool Member
Reaction score
37
You need to assign your character 2 attack types. Most people get around this by using the gun shooting more or less as an active/deactivatible ability or as an item. It can be done, some units in the game have it.

EDIT : Sorry what I mean was that in the object manager there on Combat - Attack 1, and Combat - Attack 2. You'll need to activate both.
 

Newb Mapper

New Member
Reaction score
0
I'm not quite sure what you mean may I have an example please?
I get what you mean with the Attack 1 and 2 but How by activating the second attack would it help me create a trigger for ammo
 

Tyrulan

Ultra Cool Member
Reaction score
37
Open up your object manager to the unit you want:

Change that field to BOTH. - Combat - Attacks Enabled
 

Newb Mapper

New Member
Reaction score
0
How bout if I made ammo a stackable item in the inventory and making a trigger pretty much saying when unit attacks remove 1 ammo from unit inventory if unit owning ammo = false then disable the ability to attack on the unit
would this work?
 

Tyrulan

Ultra Cool Member
Reaction score
37
It would but it is not classy and I pretty much hate any map that does it. Your original idea is much better and not that hard to do.
 

Newb Mapper

New Member
Reaction score
0
Could you send me an example through a link of an ammo system that uses lumber or a map you may have made with an ammo system please?
 

A.Dominion

New Member
Reaction score
0
this is how you do...

create a unit (marine)
with attack 1 (knife melee) u set as u like
and attack 2 (gun ranged) same

you put attack activate 1 only

you create an upgrade call ammo wich activate attack 2 only and require a unit (dummy unit) dummy unit has no shadow, child model, size 0.10 and has infestation ability. at ini or at start set ammo(upgrade) is researched.

then you do:


Trigger:
  • ini
    • Evénements
      • Temps - Elapsed game time is 0.01 seconds
    • Conditions
    • Actions
      • Visibilité - Disable fog of war
      • Visibilité - Disable black mask
      • Joueur - Set Joueur 1 (Rouge) Bois actuel to 100
      • Joueur - Set the current research level of Ammo to 1 for Joueur 1 (Rouge)
      • Set Temp_point = (Random point in (Playable map area))
      • Unité - Create 1 Dummy for Joueur 1 (Rouge) at Temp_point facing Orientation bâtiment par défaut degrees
      • Set Dummy = (Last created unit)
      • Custom script: call RemoveLocation( udg_Temp_point )


this create the tech and the dummy unit

Trigger:
  • pick up gun
    • Evénements
      • Unité - A unit Acquiert un objet
    • Conditions
      • (Item-type of (Item being manipulated)) Egal Ã_ Gun
    • Actions
      • Set gun = TRUE


this check if the marine has a gun

Trigger:
  • attack
    • Evénements
      • Unité - A unit Est attaqué
    • Conditions
      • (Attacking unit) Egal Ã_ Marine 0002 <gen>
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • Si - Conditions
          • gun Egal Ã_ TRUE
          • (Joueur 1 (Rouge) Bois actuel) Supérieur Ã_ 0
        • Alors - Actions
          • Unité - Unhide Dummy
          • Joueur - Set Joueur 1 (Rouge) Bois actuel to ((Joueur 1 (Rouge) Bois actuel) - 1)
        • Sinon - Actions
          • Unité - Hide Dummy


this run when the marine attack and remove 1 ammo at each attack, and disable ranged attack by hiding the dummy if the marine has no lumber or has dropped the gun. of course you need a trigger to set gun= false if the unit drop it.
 

Newb Mapper

New Member
Reaction score
0
I'm lost I'm pretty noob at mapping is there anyway you could put that all together for me please? or a sample map so i can study and learn from it?
Would be much appreciated
 

Tyrulan

Ultra Cool Member
Reaction score
37
I suggest you leave this to the side for now. Come back to it later when you have more practice. Try to do something more with your map, allow yourself to become more familiar with GUI.
 

Newb Mapper

New Member
Reaction score
0
You're right I'm getting the trigger and I'll try an attempt when I'm done with the rest Ive completed much of the first stages terrain on my res evil map since I started a couple hours ago and got a few trigger in there for spawns and such thanks for all your help :D
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top