• 🏆 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!

[Triggers] Upgrading system for gear.

Status
Not open for further replies.
Level 5
Joined
Dec 3, 2012
Messages
117
Working on an ORPG and want to include a kind of blacksmithing system for players' gear.

For example;

Player 1's hero has a +0 weapon called Main Gauche (Using RO samples, seeing as it will be an RO based ORPG).
Now, I want to create a blacksmithing system like in RO, where you can upgrade your gear to +10. Bit by bit, and after a certain + (depending on the weapon level) there has to be a chance to fail an upgrade.

Now, I have a way of doing this, but its slow, takes forever and requires a buttload of work creating items.

Right now, I have Main Gauche, Main Gauche +1, Main Gauche +2 etc all the way up to 10 as individual items, and everytime u choose to upgrade your weaon, it checks which one you have and if you meet the requirements, it replaces that weapon with the next level.
This requires an insane amount of triggering and item creating if I want to implement this on a large scale, and I'm just wondering if theres an easier way to do this ?

Trigger:
  • Events
    • Dialog - A dialog button is clicked for DIABlacksmith[1]
  • Actions
    • If - Conditions
      • (Clicked dialog button) Equal to DIABBlacksmith1Red[1]
    • Then - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • Or - Any (Conditions) are true
          • Conditions
            • Main Gauche Equal to (Item-type of (Item carried by HERO1Red of type Main Gauche))
            • Main Gauche Equal to (Item-type of (Item carried by UNITRentaCart[1] of type Main Gauche))
        • Or - Any (Conditions) are true
          • Conditions
            • Phracon Equal to (Item-type of (Item carried by HERO1Red of type Phracon))
            • Phracon Equal to (Item-type of (Item carried by UNITRentaCart[1] of type Phracon))
      • Then - Actions
        • Item - Remove (Item carried by HERO1Red of type Main Gauche)
        • Item - Remove (Item carried by HERO1Red of type Phracon)
        • Hero - Create Main Gauche +1 and give it to HERO1Red
      • Else - Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • Main Gauche +1 Equal to (Item-type of (Item carried by HERO1Red of type Main Gauche +1))
          • Main Gauche +1 Equal to (Item-type of (Item carried by UNITRentaCart[1] of type Main Gauche +1))
      • Or - Any (Conditions) are true
        • Conditions
          • Phracon Equal to (Item-type of (Item carried by HERO1Red of type Phracon))
          • Phracon Equal to (Item-type of (Item carried by UNITRentaCart[1] of type Phracon))
    • Then - Actions
      • Item - Remove (Item carried by HERO1Red of type Main Gauche +1)
      • Item - Remove (Item carried by HERO1Red of type Phracon)
      • Hero - Create Main Gauche +2 and give it to HERO1Red
    • Else - Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • Main Gauche +2 Equal to (Item-type of (Item carried by HERO1Red of type Main Gauche +2))
          • Main Gauche +2 Equal to (Item-type of (Item carried by UNITRentaCart[1] of type Main Gauche +2))
      • Or - Any (Conditions) are true
        • Conditions
          • Phracon Equal to (Item-type of (Item carried by HERO1Red of type Phracon))
          • Phracon Equal to (Item-type of (Item carried by UNITRentaCart[1] of type Phracon))
    • Then - Actions
      • Item - Remove (Item carried by HERO1Red of type Main Gauche +2)
      • Item - Remove (Item carried by HERO1Red of type Phracon)
      • Hero - Create Main Gauche +3 and give it to HERO1Red
    • Else - Actions
I have made a giant trigger, exactly like this, going up all the way to +10
 
Last edited:
Level 7
Joined
Jan 22, 2013
Messages
293
Working on an ORPG and want to include a kind of blacksmithing system for players' gear.

For example;

Player 1's hero has a +0 weapon called Main Gauche (Using RO samples, seeing as it will be an RO based ORPG).
Now, I want to create a blacksmithing system like in RO, where you can upgrade your gear to +10. Bit by bit, and after a certain + (depending on the weapon level) there has to be a chance to fail an upgrade.

Now, I have a way of doing this, but its slow, takes forever and requires a buttload of work creating items.

Right now, I have Main Gauche, Main Gauche +1, Main Gauche +2 etc all the way up to 10 as individual items, and everytime u choose to upgrade your weaon, it checks which one you have and if you meet the requirements, it replaces that weapon with the next level.
This requires an insane amount of triggering and item creating if I want to implement this on a large scale, and I'm just wondering if theres an easier way to do this ?

Trigger:
  • Events
    • Dialog - Button clicked for dialog BLacksmithing
  • Actions
    • If
      • Main Gauche is carried by hero OR
      • Main Gauche is carried by backpack
    • AND
      • Phracon is carried by hero OR
      • Phraco nis carried by backpack
  • Then - Actions
    • Item - Remove Main Gauche from hero
    • Item - Remove Phracon from hero
    • Hero - Create Main Gauche +1 and give to hero
I have made a giant trigger, exactly like this, going up all the way to +10

lol, well that's one way to do it if you have hours of time on your hands. I have a much faster way to do it, but its way more complicated. Do you want it? It's GUI I create everything from nothing for others lol.

One button click will check all levels and the upgrade for it, contition and w/e and such. I don't often do that much work for nothing in return but it would save you more time then it would take me to write it up.
 
Level 5
Joined
Dec 3, 2012
Messages
117
I think you typed those.
You can just right-click that paper icon then click Copy Trigger as Text.
FFFUUUUU :( Thank you!!! xD


Orthane said:
lol, well that's one way to do it if you have hours of time on your hands. I have a much faster way to do it, but its way more complicated. Do you want it? It's GUI I create everything from nothing for others lol.

One button click will check all levels and the upgrade for it, contition and w/e and such. I don't often do that much work for nothing in return but it would save you more time then it would take me to write it up.
Oh, thank god! I was afraid this was the "easiest" way of doing it xD
Well, if you could do that, that would be amazing! And it's completely trigger based ? or did GUI mean vJASS? Cause I have absolutely zero experience with vJASS so I doubt I would be able to change it when necesary D:
 
Level 7
Joined
Jan 22, 2013
Messages
293
  • Events
    • Dialog - A dialog button is clicked for DIABlacksmith[1]
  • Conditions
  • Actions
    • -------- Stage to Select What button was clicked (all will fit in one trigger) --------
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Clicked dialog button) Equal to DIABBlacksmith1Red[1]
      • Then - Actions
        • For each (Integer A) from 1 to 9, do (Actions)
          • Loop - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • Or - Any (Conditions) are true
                  • Conditions
                    • Phracon Equal to (Item-type of (Item carried by HERO1RED of type Phracon))
                    • Phracon Equal to (Item-type of (Item carried by UNITRentaCart[1] of type Phracon))
                • Or - Any (Conditions) are true
                  • Conditions
                    • Main_Gauche_Items[(Integer A)] Equal to (Item-type of (Item carried by HERO1RED of type Main_Gauche_Items[(Integer A)]))
                    • Main_Gauche_Items[(Integer A)] Equal to (Item-type of (Item carried by UNITRentaCart[1] of type Main_Gauche_Items[(Integer A)]))
              • Then - Actions
                • -------- Prevents Removing Extra Items --------
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • Phracon Equal to (Item-type of (Item carried by HERO1RED of type Phracon))
                  • Then - Actions
                    • Item - Remove (Item carried by HERO1RED of type Phracon)
                  • Else - Actions
                    • Item - Remove (Item carried by UNITRentaCart[1] of type Phracon)
                • -------- Prevents Removing Extra Items --------
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • Main_Gauche_Items[(Integer A)] Equal to (Item-type of (Item carried by HERO1RED of type Main_Gauche_Items[(Integer A)]))
                  • Then - Actions
                    • Item - Remove (Item carried by HERO1RED of type Main_Gauche_Items[(Integer A)])
                  • Else - Actions
                    • Item - Remove (Item carried by UNITRentaCart[1] of type Main_Gauche_Items[(Integer A)])
                • -------- Give Upgraded Item --------
                • Set LocationLeak = (Position of HERO1RED)
                • Item - Create Main_Gauche_Items[((Integer A) + 1)] at (Position of HERO1RED)
                • Hero - Give (Last created item) to HERO1RED
              • Else - Actions
      • Else - Actions
    • Custom script: call RemoveLocation(udg_LocationLeak)
There you go.

Downside:
IF you have more then one Phracon, it will consume them all into the upgrade; upgrading it as many times as the number of Phracon's you have.
 
Level 5
Joined
Dec 3, 2012
Messages
117
Thank you!
I tried to use some For each A, from 1 to 10 do ... but I couldn't quite figure out how to use it D:
I'll implement this soon, thanks ! :)
 
Level 7
Joined
Jan 22, 2013
Messages
293
dont use for each integer A instead use ur own integer. integer A is slower than using ur own integer and it can cause bugs.

What kind of bugs do you speak of? In my oppinon I think it wont if used Properly. I use it all the time, no problems. Its a waste of space to add more variables for something there. I use Integers inside of integers inside of integer arrays. I have never had problems with the loops. Very simple.

What he has is fine, its works. People in GUI don't care about speed otherwise they would be Jass/Vjass Death.
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
What kind of bugs do you speak of? In my oppinon I think it wont if used Properly. I use it all the time, no problems. Its a waste of space to add more variables for something there. I use Integers inside of integers inside of integer arrays. I have never had problems with the loops. Very simple.

What he has is fine, its works. People in GUI don't care about speed otherwise they would be Jass/Vjass Death.

when i was coding in GUI it had some odd bugs every now and again. one time it would bug the next it wouldnt. As for ur second post speed should be cared about no matter what u use to make ur map in. while GUI is slower than jass / vJass it can still be a good tool for map making. But if u code loosely ur map will suffer so speed is always something to care about. Also if u dont have waits in the for each integer block then all u need is one temp integer for all for each integer blocks

Poorly coded GUI is just like not removing leaks. If a game lags because of poor coding chances are no1 will want to play the map and u wont enjoy the map that took u so long to make
 
Level 5
Joined
Dec 3, 2012
Messages
117
It works like a charm! :)

One thing about the downside though, when you have multiple Phracons in your inventory, it immediately does them all, is there any way to prevent this ?
 
Level 7
Joined
Jan 22, 2013
Messages
293
It works like a charm! :)

One thing about the downside though, when you have multiple Phracons in your inventory, it immediately does them all, is there any way to prevent this ?

I will have to add it to the code, if you want that.

when i was coding in GUI it had some odd bugs every now and again. one time it would bug the next it wouldnt. As for ur second post speed should be cared about no matter what u use to make ur map in. while GUI is slower than jass / vJass it can still be a good tool for map making. But if u code loosely ur map will suffer so speed is always something to care about. Also if u dont have waits in the for each integer block then all u need is one temp integer for all for each integer blocks

Poorly coded GUI is just like not removing leaks. If a game lags because of poor coding chances are no1 will want to play the map and u wont enjoy the map that took u so long to make

Ight i'll keep that in mind.
 
Level 7
Joined
Jan 22, 2013
Messages
293
Would be extremely helpful, definitely another REP if you could :)

No need to give rep again, you can't anyway lol.


  • Melee Initialization
    • Events
      • Dialog - A dialog button is clicked for DIABlacksmith[1]
    • Conditions
    • Actions
      • -------- Stage to Select What button was clicked (all will fit in one trigger) --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to DIABBlacksmith1Red[1]
        • Then - Actions
          • For each (Integer A) from 1 to 9, do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Used_1_Phracon[1] Equal to False
                  • Or - Any (Conditions) are true
                    • Conditions
                      • Phracon Equal to (Item-type of (Item carried by HERO1RED of type Phracon))
                      • Phracon Equal to (Item-type of (Item carried by UNITRentaCart[1] of type Phracon))
                  • Or - Any (Conditions) are true
                    • Conditions
                      • Main_Gauche_Items[(Integer A)] Equal to (Item-type of (Item carried by HERO1RED of type Main_Gauche_Items[(Integer A)]))
                      • Main_Gauche_Items[(Integer A)] Equal to (Item-type of (Item carried by UNITRentaCart[1] of type Main_Gauche_Items[(Integer A)]))
                • Then - Actions
                  • -------- Prevents Removing Extra Items --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Phracon Equal to (Item-type of (Item carried by HERO1RED of type Phracon))
                    • Then - Actions
                      • Item - Remove (Item carried by HERO1RED of type Phracon)
                    • Else - Actions
                      • Item - Remove (Item carried by UNITRentaCart[1] of type Phracon)
                  • -------- Prevents Removing Extra Items --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Main_Gauche_Items[(Integer A)] Equal to (Item-type of (Item carried by HERO1RED of type Main_Gauche_Items[(Integer A)]))
                    • Then - Actions
                      • Item - Remove (Item carried by HERO1RED of type Main_Gauche_Items[(Integer A)])
                    • Else - Actions
                      • Item - Remove (Item carried by UNITRentaCart[1] of type Main_Gauche_Items[(Integer A)])
                  • -------- Give Upgraded Item --------
                  • Set LocationLeak = (Position of HERO1RED)
                  • Item - Create Main_Gauche_Items[((Integer A) + 1)] at (Position of HERO1RED)
                  • Hero - Give (Last created item) to HERO1RED
                  • Custom script: call RemoveLocation(udg_LocationLeak)
                  • Custom script: call set udg_LocationLeak = null
                  • Set Used_1_Phracon[1] = True
                • Else - Actions
        • Else - Actions
 
Status
Not open for further replies.
Top