Problem with catch pokemon trigger

Erkki2

New Member
Reaction score
0
I have made a trigger for catching pokemon in my map. Here's the trigger:
Code:
Catch
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        Or - Any (Conditions) are true
            Conditions
                (Number of units in (Units in Party <gen>)) Less than 6
                (Number of units in (Units in Box <gen>)) Less than 100
        (Owner of (Target unit of ability being cast)) Equal to Neutral Hostile
    Actions
        Wait 0.10 seconds
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Ability being cast) Equal to Catch (poke)
            Then - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Random real number between 0.00 and ((Life of (Target unit of ability being cast)) + ((Max life of (Target unit of ability being cast)) / 5.00))) Less than or equal to 25.00
                    Then - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                (Number of units in (Units in Party <gen>)) Less than 6
                            Then - Actions
                                Unit - Move (Target unit of ability being cast) instantly to (Center of Party <gen>)
                                Unit - Change ownership of (Target unit of ability being cast) to Player 1 (Red) and Change color
                            Else - Actions
                                Unit - Move (Target unit of ability being cast) instantly to (Center of Box <gen>)
                                Unit - Change ownership of (Target unit of ability being cast) to Neutral Passive and Change color
                        Trigger - Run Victory <gen> (ignoring conditions)
                    Else - Actions
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Ability being cast) Equal to Catch (Great)
            Then - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Random real number between 0.00 and ((Life of (Target unit of ability being cast)) + ((Max life of (Target unit of ability being cast)) / 5.00))) Less than or equal to 50.00
                    Then - Actions
                        Trigger - Run Victory <gen> (ignoring conditions)
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                (Number of units in (Units in Party <gen>)) Less than 6
                            Then - Actions
                                Unit - Move (Target unit of ability being cast) instantly to (Center of Party <gen>)
                                Unit - Change ownership of (Target unit of ability being cast) to Player 1 (Red) and Change color
                            Else - Actions
                                Unit - Move (Target unit of ability being cast) instantly to (Center of Box <gen>)
                                Unit - Change ownership of (Target unit of ability being cast) to Neutral Passive and Change color
                    Else - Actions
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Ability being cast) Equal to Catch (Ultra)
            Then - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Random real number between 0.00 and ((Life of (Target unit of ability being cast)) + ((Max life of (Target unit of ability being cast)) / 5.00))) Less than or equal to 100.00
                    Then - Actions
                        Trigger - Run Victory <gen> (ignoring conditions)
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                (Number of units in (Units in Party <gen>)) Less than 6
                            Then - Actions
                                Unit - Move (Target unit of ability being cast) instantly to (Center of Party <gen>)
                                Unit - Change ownership of (Target unit of ability being cast) to Player 1 (Red) and Change color
                            Else - Actions
                                Unit - Move (Target unit of ability being cast) instantly to (Center of Box <gen>)
                                Unit - Change ownership of (Target unit of ability being cast) to Neutral Passive and Change color
                    Else - Actions
            Else - Actions
The trigger should move the pokemon to party (region) if player has more than 6 pokemon, and to box if player has less. Instead it moves the pokemon to party, no matter how many pokemon the player has and doesn't change owner. How could I fix that? The victory trigger is run as it should.
 

Light Alkmst

New Member
Reaction score
20
You're using or in the conditions between party < 6 and box < 100. As long as the number of units in box < 100, it will run...
 

CaptDeath

New Member
Reaction score
103
first off this and this leaks
Trigger:
  • Unit - Move (Target unit of ability being cast) instantly to (Center of Party &lt;gen&gt;)
    • AND THIS!
      • Unit - Move (Target unit of ability being cast) instantly to (Center of Box &lt;gen&gt;)
    • LEAK!
 

Erkki2

New Member
Reaction score
0
It doesn't matter if it leaks a little since it's a single player map. And when I tested it I had 4 pokemon in party and 0 in box. I also tried it without wait function and first 2 pokemon it worked, but pokemon that I captured later didn't change owner and were moved to party.

Edit: I also noticed that the chances aren't counted right. For example, a level 1 pidgey has 70 hp. When I capture it at full health, the game should select a random number between 0 and 84. The chance the random number is less than 25 is around 30%. And I succeed to capture it every time.
 
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