• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

n00b map maker lots of Q's ^^

Status
Not open for further replies.
Level 2
Joined
Jul 10, 2004
Messages
11
'ello im a n00b map maker, i used to make maps in starcraft which was like 4 years ago so i have a basic feel for the trigger system. In warcraft they have allowed the editor to be very unlimited, if you want to do it, you could almost certinaly do it with the right knowledge behind it seems.

Well back to the point, i am planning to make a map and it seems all the good ones are custom with imported this and that and new ways of system etc. so my first question, more to come for sure is

In the night of the dead II they have a system where ammo=gold clips=lumber. when yer ammo runs out you stop firing and reload. when yer reload is done your lumber goes down by 1 and you have ammo again to shoot with.
1.
Now i am wondering how is it possible to say have 3 units. these 3 units will be bound by this system but all 3 are indepenent as they reload when ever their ammo runs out. So unit A has 6 ammo per clip, unit B has 12 ammo per clip, and unit C has 30 ammo per clip and they all will reload when they run out so Unit A would reload twice as much as unit B etc.
2.
I dont know how to bound a unit attack to something. I've seen it in some games where everytime a unit attacks 1 arrow is taken, and if he runs out of arrows he cannot attack no more unless he gets more. How do you go about in doing this?

More will come as i go deeper in this map, thanks for all the help thats coming to me, and great website too.
 
Hmm... here are my answers... they may not be exact because I dont have my editor right now (im posting from my dad's computer) Ill try my best though.


1) This is the first trigger...

EVENT :
- Unit begins casting (your attack spell)
CONDITIONS :
- Triggering Unit is equal to (your unit)
ACTIONS :
- Set (owner of triggering unit) gold to 6

- Add -1 gold to (owner of triggering unit) gold.



Then, create a new trigger, and make it like this...


EVENT :
- Unit stops casting a spell
CONDITIONS :
- Triggering unit equal to (your unit)
ACTIONS :
- Wait 1 second
- Set (owner of triggering unit) gold to 6

That is what the trigger would be like for the unit with 6 rounds.... you would need to also make a custom spell that the units would use universally (just name is fire or something) Im not sure if this is going to work though since i havent tested it yet...
 
And here is the second trigger...

2) EVENT :
- Unit begins casting an ability
CONDITIONS :
- Item-type of (item carried by casting unit (in slot one)) equal to (arrows)
- Item-type of (item carried by casting unit (in slot two)) equal to (arrows)
- Item-type of (item carried by casting unit (in slot three)) equal to (arrows)
- Item-type of (item carried by casting unit (in slot four)) equal to (arrows)
- Item-type of (item carried by casting unit (in slot five)) equal to (arrows)
- Item-type of (item carried by casting unit (in slot six)) equal to (arrows)
- Triggering unit is equal to (your unit)
ACTION :
- Order (unit) to use (arrows)

NOTE : The next trigger is an if, then, else trigger!!

- If (((Triggering Unit) has an item of type (arrows) Equal to False) then do (Unit - remove (your attack ability) from (unit) else (do nothing)
- If (((Triggering Unit) has an item of type (arrows) Equal to True) then do (Unit - add (your attack ability) from (unit) else (do nothing)

Also in this trigger you would need to make a custom item called 'arrows'. Hope I helped!
 

c3o

c3o

Level 2
Joined
Feb 17, 2004
Messages
21
To the first question. This can easily be done with some triggers:

Step 1. Don't got TFT? Get it!

Step 2. Create the following variables. If you don't know what variables are, they are like switches but can hold any value, units, an integer or strings. An array is, well and array of variables accessed by a integer Index.

unit array MadShooter = Set this variable to the unit you want to shoot at the beginning of the game (Or when he enter it). This is presuming you only have one unit per player which are shooting. I can write a system for more units, but didn't do it right now, tell me if you need it. The Index should be the player number of the owner of the shooter.
Example:
set MadShooter[Player Number of Player 1 (Red))] = *Your shooter*

integer array AmmoCount = This is the number of ammo a units get when they reload. The Index should be the player number of the owner of the shooter.

integer TempInteger = Only for the purpose that I'm lazy and don't want to click so much. Holds the integer number of a player.

3. Then create the following triggers:
Code:
//The shooting trigger

Shooting
    Events
        Unit - A unit Is attacked//Launches everytime a unit is attacked. Or, actually the moment before a unit is going to attack another unit.
    Conditions
        (Attacking unit) Equal to MadShooter[(Player number of (Owner of (Attacking unit)))]//Checks so that the "Shooter" attacks.
    Actions
        Set TempInteger = (Player number of (Owner of (Attacking unit)))//Sets TempInteger to the attacking units owners playernumber.
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Owner of MadShooter[TempInteger]) Current gold) Equal to 0//So if he has no ammo left. This will happen.
            Then - Actions
                Unit - Order MadShooter[TempInteger] to Stop//Stops the unit from firing his gun by ordering him to stop a millisecond before. This should work practically. Not totally sure though.
                Game - Display to (Player group((Owner of MadShooter[TempInteger]))) for 10.00 seconds the text: Out of Ammo!//This is just something I made so you know that you're out of ammo.
                Skip remaining actions//Skips the remaining actions, simply.
            Else - Actions
        Player - Set (Owner of MadShooter[TempInteger]) Current gold to (((Owner of MadShooter[TempInteger) Current gold) - 1)//Sets the gold of the owner of the attacking unit -1. Which will create the effect of the ammo going down.

//The Reload trigger.

Reload
    Events
        Unit - A unit Starts the effect of an ability//Fires when a unit casts an ability, this is presuming that reload IS an ability to :P
    Conditions
        (Ability being cast) Equal to Reload//Checks so the right abiliy is cast, I named it "Reload" couse it's pretty logical.
        (Casting unit) Equal to MadShooter[(Player number of (Owner of (Attacking unit)))]//Checks so the caster is the right unit.
    Actions
        Set TempInteger = (Player number of (Owner of (Attacking unit)))//~Same as before~
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Owner of MadShooter[TempInteger]) Current lumber) Equal to 0//If he got no clips, to bad for him, whahahaha!
            Then - Actions
                Game - Display to (Player group((Owner of MadShooter[TempInteger]))) for 10.00 seconds the text: Out of Clips!//Message...
                Skip remaining actions//bla bla
            Else - Actions
        Player - Set (Owner of MadShooter[TempInteger]) Current lumber to (((Owner of MadShooter[ATempInteger]) Current lumber) - 1)//Changes his amount of clips = clips-1
        Player - Set (Owner of MadShooter[TempInteger]) Current gold to AmmoCount[TempInteger]//The "AmmoCount" is for each "gun" and keeps track of how much he should get every time he reload.

//Pick up a clip...!

More Ammo
    Events
        Unit - A unit Acquires an item//When a unit pciks up an item.
    Conditions
        (Hero manipulating item) Equal to MadShooter[(Player number of (Owner of (Attacking unit)))]//So the shooter picks up the clip...
        (Item-type of (Item being manipulated)) Equal to Clip//Checks so he actually DOES pick up a clip.
    Actions
        Player - Set (Owner of MadShooter[TempInteger]) Current lumber to (((Owner of MadShooter[TempInteger]) Current lumber) + 1)//Sets the amount of clips = clips+1. This trigger can ofcourse be duplicated to clippack+2 etc.

I haven't tried this. But It should do what you want. To get some spiffy effect on the lumber/gold display you can change the graphics etc in the game interface. And the first answer prettymuch answered the second question to, didn't it? oh well. Tired as hell right now. Good Night.
 
Level 2
Joined
Jul 10, 2004
Messages
11
hmm... would this work just the idea. Lumber=ammo.
Instead of -1 lumber each time the unit shoots it -1 mp. When mp = 0 the unit has to reload therefore taking x amount of lumber to get full mp. This will allow for multiple units to grab from the lumber but reload at different times.
 

c3o

c3o

Level 2
Joined
Feb 17, 2004
Messages
21
Yes it will. But since I got so fascinated of the idea of a system which support a nearly unlimited amount of units I started to write a engine for this. I will submit it when it's bugfree.

About making it so the mp counts simply change all "current gold of player" to "current mana of unit" (Real comparison I think).
 
Level 2
Joined
Jul 10, 2004
Messages
11
Set TempInteger = (Player number of (Owner of (Attacking unit)))//Sets TempInteger to the attacking units owners playernumber.

wheres that? i can't find it. . .
 
Level 13
Joined
May 5, 2004
Messages
1,330
Be sure your variable is an integer-variable

Variable Name: TempInteger
Variable Type: Integer (integer)

Then add the action "Set Variable"
In the first field you select your variable

-> Set TempInteger = value

After that you can click on "value" (what's now in red letters)

In the following window you have to mark "Function" and then select the function "Player - Player Number"

Click where now stand "TriggeringPlayer" and change it to "Owner Of Unit" where you change "Triggering Unit" to "AttackingUnit"
 
Status
Not open for further replies.
Top