[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.

      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