damaging a unit, harder then it looks?

n4bieclimber

New Member
Reaction score
1
owk the story i want to damage a creep that has been attacked this was the event for the dialog "nunchaku_attack_menu"

so the menu pops up and i click Fire pit. wich sets the next trigger in action

with the current trigger i manage to damage nothing, the creep, myself or the creep and myself.

any suggestions. i can post all of the triggers that are relevant to this and to solving this if u need them

Code:
Clicked Fire Pit
    Events
        Dialog - A dialog button is clicked for Nunchaku_attack_menu
    Conditions
        (Clicked dialog button) Equal to Fire_Pit
    Actions
        Unit - Cause (Random unit from (Units owned by (Triggering player) of type Riu Hayabusa)) to damage (Random unit from (Units within 250.00 of (Position of (Random unit from (Units owned by (Triggering player) of type Riu Hayabusa))) matching ((Unit-type of (Random unit from (Units within 250.00 of (Position of (Random unit from (Units owned by (Triggering p, dealing 125.00 damage of attack type Normal and damage type Normal
        Unit - Unpause (Random unit from (Units within 250.00 of (Position of (Random unit from (Units currently selected by (Triggering player))))))
        Wait 1.00 seconds
        Trigger - Run Nunchaku_attack_trigger (checking conditions)
 

vypur85

Hibernate
Reaction score
803
WOW o_O

There are too many randomness, that's why the conditions can hardly be fulfilled. So the damage action is not carried out. Try to use specific unit instead of multiple random units. Or try to set the random unit into a variable then use the same variable over and over again so that it will work.

A lame analogy:
It's just like lottery. The first digit is a random number between 0 to 9. Same goes to the second and third digits. All are random. So what is the chance of you getting a 000?
 

n4bieclimber

New Member
Reaction score
1
thats not entirely true the first and the second are sort of 1 out of 1 out of 1 cause the player owns just one unit. that is in his unit group. that is Ryo Hayabusa.

So that cant be the problem?...

further can u explain a bit better what u mean with setting integer (in this context (i use integers all the time))?
 

Builder Bob

Live free or don't
Reaction score
249
To me it looks like the trigger is actually cut of from being too long

Code:
(Random unit from (Units owned by (Triggering p, dealing 125.00 damage of attack

It should read (Triggering player), etc. There are not an even number of ('s and )'s either. Do you manage to save the map as that? I'd expect errors.

Anyway, try to make a unit variable and set it to
Code:
Set MyRandomAttackingUnit = (Random unit from (Units owned by (Triggering player) of type Riu Hayabusa))
Set MyRandomVictimUnit = (Random unit from (Units within 250.00 of (Position of (Random unit from (Units owned by (Triggering player) of type Riu Hayabusa))) matching (...etc. the rest if cut off in your trigger...)
Maybe this will help to shorten down the line so it won't get cut off in the middle


(By the way, you might want to do a search on cleaning up group leaks)
 

n4bieclimber

New Member
Reaction score
1
well thanks for the help but i think i go for a player by player approach i just can 't seem to get it right so i making a variable for every attacked unit of player 12 by a ryo hayabusa af a player.

but now i have another problem i want the ryo to have a recovery time for every attack he does in that time he takes damage from his enemy's. but i cant seem to get the victim creep to attack my character here are 2 script that belong to each other.

any idea whats going wrong.

ps.: short bug discription the victim creep walks closer to ryu but does not attack him

Code:
Attack with Nunchaku
    Events
        Unit - A unit owned by Player 12 (Brown) Is attacked
    Conditions
        (Item-type of (Item carried by (Attacking unit) in slot 1)) Equal to Nunchaku
        (Attacking unit) Equal to (Random unit from (Units owned by Player 1 (Red) of type Riu Hayabusa))
    Actions
        Set Nunchaku_attack_trigger_pl1 = (This trigger)
        Set Unit_attacked_by_pl1 = (Attacked unit)
        Unit - Pause Riu Hayabusa 0000 <gen>
        Dialog - Show Nunchaku_attack_menu for Player 1 (Red)

Code:
Clicked Fire Pit
    Events
        Dialog - A dialog button is clicked for Nunchaku_attack_menu
    Conditions
        (Clicked dialog button) Equal to Fire_Pit
    Actions
        Unit - Order Unit_attacked_by_pl1 to Attack (Random unit from (Units owned by Player 1 (Red) of type Riu Hayabusa))
        Unit - Cause (Random unit from (Units owned by Player 1 (Red) of type Riu Hayabusa)) to damage Unit_attacked_by_pl1, dealing 125.00 damage of attack type Normal and damage type Normal
        Wait 2.00 seconds
        Unit - Unpause (Random unit from (Units owned by Player 1 (Red) of type Riu Hayabusa))
 

Larcenist

REP: Respect, Envy, Prosperity?
Reaction score
211
Code:
Clicked Fire Pit
    Events
        Dialog - A dialog button is clicked for Nunchaku_attack_menu
    Conditions
        (Clicked dialog button) Equal to Fire_Pit
    Actions
        Unit - Cause (Random unit from (Units owned by (Triggering player) of type Riu Hayabusa)) to damage (Random unit from (Units within 250.00 of (Position of (Random unit from (Units owned by (Triggering player) of type Riu Hayabusa))) matching [B]((Unit-type of (Random unit from (Units within 250.00 of (Position of (Random unit from (Units owned by (Triggering p, dealing 125.00 damage of attack type Normal and damage type Normal[/B]
        Unit - Unpause (Random unit from (Units within 250.00 of (Position of (Random unit from (Units currently selected by (Triggering player))))))
        Wait 1.00 seconds
        Trigger - Run Nunchaku_attack_trigger (checking conditions)

I can't seem to find anything checking for "matching unit" or "Owner of matching unit". So you're using a condition that requires a matching unit, and you never declare that matching unit.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top