[System Request] Save/load for no of games played.

Phoenixman

New Member
Reaction score
0
Hey all, i could do with some advise for my map, http://www.thehelper.net/forums/showthread.php?t=144100

i wasnt sure which was the correct forum area for asking questions so feel free to move it if i got it wrong :p

Basically the system i want im not sure if its possible, it would be similar to the city of drugs map system.
I want the player to be able to unlock new characters to play with the more games hes played etc.

like if a player has played 5 games he unlocks the "mechanic" who is a harder to play class with its own benefits, not suitable for players who havent played before and so on.
everytime the player plays the map to the end ( the round must last say 15mins) and saves the code he gets given at the end, it saves how many games he has accumilated, and each time he loads his code at the start of the map it tells the player how many games hes played and how many more he needs to unlock the next class.

then the system checks what number of games he has played and shows him the heros he can choose.

any advice on a system like this? is it possible? and if so is there anyone who could help me at all? its important to me because it effectively stops a newb player feeding the other team because they dont know how to play the game.

think about the Satyr in island defense. how many times he would die feeding the titan so much that the game would end alot faster then anyone wanted
 

Phoenixman

New Member
Reaction score
0
thank should work :p
but how do i get it to count the ammount of games played? or add to that everytime the player has been in that game for more then 15mins etc? :p

sorry im bad at this area, ironically im a software engineer at uni, first year :/
 

Phoenixman

New Member
Reaction score
0
could someone explain to me how id use this system to create a saveload code just for games played?
then to create something that checks this code and then allows the player to only choose heros he has unlocked?

:p
im a newb to wc3 coding.

embarrsing since im learning C# and C++ at uni atm :/
 

HydraRancher

Truth begins in lies
Reaction score
197
Ok.

Trigger:
  • Initiallization
    • Events
      • Map Initiallization
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12 do (Actions)
        • Loop - Actions
          • Set GAMESPLAYED[(Integer A)] = 1


Trigger:
  • SaveLoad Load Hero
    • Events
      • Player - Player 1 (Red) types a chat message containing -load as A substring
      • Player - Player 2 (Blue) types a chat message containing -load as A substring
      • Player - Player 3 (Teal) types a chat message containing -load as A substring
      • Player - Player 4 (Purple) types a chat message containing -load as A substring
    • Conditions
      • (Substring((Entered chat string), 1, 6)) Equal to (Matched chat string)
      • (Length of (Entered chat string)) Greater than 6
    • Actions
      • -------- Try to decode what was typed --------
      • Set Code = (Substring((Entered chat string), 7, (Length of (Entered chat string))))
      • Custom script: set udg_Validate = SaveLoad_Decode( udg_Code )
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Validate Equal to False
        • Then - Actions
          • -------- Invalid code --------
          • Game - Display to (Player group((Triggering player))) the text: There's some error ...
          • Skip remaining actions
        • Else - Actions
      • -------- It worked, let's do something with it --------
      • Set GAMESPLAYED[(Player Number of (Triggering Player))] = GAMESPLAYED[(Player Number of (Triggering Player))] + Save[Save Count]
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • GAMESPLAYED[(Player Number of (Triggering Player))] is greater than (>) 4
        • Then - Actions
          • Unit - Make Hero 1 available for training for (Triggering Player)
        • Else - Actions
      • --------------Do this as many times as you want--------
 

Phoenixman

New Member
Reaction score
0
ill give it a ago tomorrow and tell you if it works :)
also im having a problem with this code that i got from here
http://www.hiveworkshop.com/forums/...a-152465/?prev=search=meat%20hook&d=list&r=20

In the bit

Trigger:
  • Unit Group - Pick every unit in (Units within 64.00 of PH_Hook_Point[PH_Index[3]] matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of PH_Caster[PH_Index[3]])) Equal to True))) and do (Actions)


i want it not to be able to target buildings as right now you can pull a building with the chain, aswell as a unit.
i tried adding a if condition of "if unit is a building = false" under it but that made it ignore the building and go through it to capture the human, i want it to bounce off like its hit a wall.
because thats the strategy humans will need to use as defense, walling there open spots etc :p



Trigger:
  • Hook Loop
    • Events
    • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
    • For each (Integer PH_Index[3]) from 1 to PH_Index[2], do (Actions)
    • Loop - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • PH_Counter[PH_Index[3]] Less than PH_Distance
    • Then - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • PH_Hooked_Is[PH_Index[3]] Equal to False
    • Then - Actions
    • -------- ----------------------- --------
    • -------- Moving hook and creating effects --------
    • -------- ----------------------- --------
    • -------- Counter incrasing --------
    • Set PH_Counter[PH_Index[3]] = (PH_Counter[PH_Index[3]] + 1)
    • -------- ----------------------- --------
    • -------- Set Locations and move Hook dummy --------
    • Set PH_Dummy_Point[PH_Index[3]] = (Position of PH_Dummy[PH_Index[3]])
    • Set PH_Hook_Point[PH_Index[3]] = (PH_Dummy_Point[PH_Index[3]] offset by 30.00 towards PH_Hook_Angle[PH_Index[3]] degrees)
    • -------- ----------------------- --------
    • Unit - Move PH_Dummy[PH_Index[3]] instantly to PH_Hook_Point[PH_Index[3]]
    • Unit - Create 1 Effect for (Owner of PH_Caster[PH_Index[3]]) at PH_Dummy_Point[PH_Index[3]] facing PH_Hook_Angle[PH_Index[3]] degrees
    • Unit - Turn collision for (Last created unit) Off
    • Unit Group - Add (Last created unit) to PH_Effects[PH_Index[3]]
    • Hashtable - Save Handle Of(Last created unit) as PH_Counter[PH_Index[3]] of PH_Index[3] in PH_Table
    • -------- ----------------------- --------
    • -------- Hooking enemy unit --------
    • -------- ----------------------- --------
    • Custom script: set bj_wantDestroyGroup = true
    • Unit Group - Pick every unit in (Units within 64.00 of PH_Hook_Point[PH_Index[3]] matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of PH_Caster[PH_Index[3]])) Equal to True))) and do (Actions)
    • Loop - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • ((Picked unit) is Magic Immune) Equal to False
    • PH_Hooked_Is[PH_Index[3]] Equal to False
    • Then - Actions
    • Set PH_Hooked_Unit[PH_Index[3]] = (Picked unit)
    • Set PH_Hooked_Is[PH_Index[3]] = True
    • Unit - Pause (Picked unit)
    • Unit - Turn collision for (Picked unit) Off
    • -------- ----------------------- --------
    • -------- Deal damage --------
    • Unit - Cause PH_Caster[PH_Index[3]] to damage (Picked unit), dealing (Real(PH_Damage)) damage of attack type Spells and damage type Lightning
    • -------- ----------------------- --------
    • Else - Actions
    • Custom script: call RemoveLocation(udg_PH_Dummy_Point[udg_PH_Index[3]])
    • Custom script: call RemoveLocation(udg_PH_Hook_Point[udg_PH_Index[3]])
    • -------- Leaks Removed --------
    • -------- ----------------------- --------
    • -------- ----------------------- --------
    • -------- No unit hooked? --------
    • -------- ----------------------- --------
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • PH_Counter[PH_Index[3]] Equal to PH_Distance
    • Then - Actions
    • Set PH_Hooked_Is[PH_Index[3]] = True
    • Unit - Unpause PH_Caster[PH_Index[3]]
    • Else - Actions
    • -------- ----------------------- --------
    • -------- ----------------------- --------
    • -------- ----------------------- --------
    • Else - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • PH_Hooked_Is[PH_Index[3]] Equal to True
    • Then - Actions
    • -------- ----------------------- --------
    • -------- Moving Hook back --------
    • -------- ----------------------- --------
    • -------- Counter decrasing --------
    • Set PH_Counter[PH_Index[3]] = (PH_Counter[PH_Index[3]] - 1)
    • -------- ----------------------- --------
    • -------- Setting locations to move Hook dummy and hooked unit --------
    • Set PH_Dummy_Point[PH_Index[3]] = (Position of PH_Dummy[PH_Index[3]])
    • Set PH_Hook_Point[PH_Index[3]] = (PH_Dummy_Point[PH_Index[3]] offset by 30.00 towards (PH_Hook_Angle[PH_Index[3]] - 180.00) degrees)
    • -------- ----------------------- --------
    • -------- Destroy effect of hook --------
    • Set PH_Effect = (Load (PH_Counter[PH_Index[3]] + 1) of PH_Index[3] in PH_Table)
    • Unit - Kill PH_Effect
    • Unit - Remove PH_Effect from the game
    • -------- ----------------------- --------
    • -------- ----------------------- --------
    • Unit - Move PH_Dummy[PH_Index[3]] instantly to PH_Hook_Point[PH_Index[3]]
    • -------- ----------------------- --------
    • -------- Moving hooked unit --------
    • -------- ----------------------- --------
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • PH_Hooked_Unit[PH_Index[3]] Not equal to No unit
    • Then - Actions
    • Unit - Move PH_Hooked_Unit[PH_Index[3]] instantly to PH_Dummy_Point[PH_Index[3]]
    • Else - Actions
    • Custom script: call RemoveLocation(udg_PH_Dummy_Point[udg_PH_Index[3]])
    • Custom script: call RemoveLocation(udg_PH_Hook_Point[udg_PH_Index[3]])
    • -------- ----------------------- --------
    • -------- Leaks Removed --------
    • -------- ----------------------- --------
    • Else - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • PH_Counter[PH_Index[3]] Equal to 0
    • Then - Actions
    • -------- ----------------------- --------
    • -------- Removing hook and unpause caster --------
    • -------- ----------------------- --------
    • Unit - Kill PH_Dummy[PH_Index[3]]
    • Unit - Remove PH_Dummy[PH_Index[3]] from the game
    • Unit - Unpause PH_Caster[PH_Index[3]]
    • Animation - Reset PH_Caster[PH_Index[3]]'s animation
    • Custom script: call DestroyGroup(udg_PH_Effects[udg_PH_Index[3]])
    • -------- ----------------------- --------
    • -------- Unpause Hooked unit --------
    • -------- ----------------------- --------
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • PH_Hooked_Unit[PH_Index[3]] Not equal to No unit
    • Then - Actions
    • Unit - Unpause PH_Hooked_Unit[PH_Index[3]]
    • Unit - Turn collision for PH_Hooked_Unit[PH_Index[3]] On
    • Else - Actions
    • -------- ----------------------- --------
    • -------- Spell Ending --------
    • -------- ----------------------- --------
    • Set PH_Index[1] = (PH_Index[1] - 1)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • PH_Index[1] Equal to 0
    • Then - Actions
    • Set PH_Index[2] = 0
    • Trigger - Turn off (This trigger)
    • Else - Actions
    • Else - Actions
    • Else - Actions


ideas?
 

Phoenixman

New Member
Reaction score
0
how do i copy paste it properly? because i just tried to copy paste it and it came out like what you saw above? :(
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +1
  • V-SNES V-SNES:
    Happy Friday!
    +1

      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