WIP Villager RP [ Old map remake ]

Denegoth

New Member
Reaction score
18
Update 0.065
Alchemy has been put on hold until later on. Magic is in progress instead.
 

LoveRPG

Member
Reaction score
6
It always fun to look back at old maps and realise that the code was completely shit:) Noticed the first map I made with triggers, acctually puttet it up here i think if anyone wants to try it. Any how the map had several really messed up triggers, like I had the most weird and unnecessary. Example was I had Player types a message... and Map inizialation on the same trigger:p just wanted to share, like an AA meet:) But like AWE:) I would like to test the map, message me if there is anything i might be able to help with:)
 

Denegoth

New Member
Reaction score
18
I'll probably upload a small demo of the map when I reach 0.20 or so.

Heres a list of what I'm adding in the next few versions:

  • Alchemy
  • Cooking
  • Mining


 

Denegoth

New Member
Reaction score
18
Update 0.08
Alchemy has been implemented. Female Villager [Agile] and Female Villager [Strong] have been added. Items clipped from plants now all have weak effects.
 

Denegoth

New Member
Reaction score
18
Update 0.09
  • Save/Load Code has been added
  • Alchemy now has a rate of failure
  • Alchemy now requires less experience to level up
  • A title system has been implemented. Everyone starts off with a name like "Villager - Denegoth". You can rename yourself, but it will only change the actual name part. Titles can be bought once you reach a certain level in a skill.

0.09 is not finished yet, so this post will be updated.
 

Denegoth

New Member
Reaction score
18
Update 0.095

  • Woodcutting is in progress
  • Saving now saves items
  • A weapon system has been added. Clicking the weapon shows the weapon on you and gives you the "Unequip" ability.


 

Denegoth

New Member
Reaction score
18
Currently having problems with Saving and Woodcutting. Should have it fixed soon though.
 

Denegoth

New Member
Reaction score
18
Woodcutting is now fine. Saving is still a problem though. I have no choice but to make it so items don't save.
 

Samael88

Evil always finds a way
Reaction score
181
How are you saving it?

By the assumtion that you are crypting down all saved data into a code, am I wrong?

Then you could make a list of all the items in the game(hard work tho)
and then have them loaded into an array and check what items the players have in their slots, that was what I did when I made my save system a few years back.
I never got around to get the loading part to work tho, but I assume you got that working for the rest, and then it would be to do the same with the items aswell:)

If you want to get some help on the saving system but don't want to reveal the code, you could send me a pm with it in:) I have quit using WE for about a year ago, but I think that I can try to help you out with this one:thup:
 

Denegoth

New Member
Reaction score
18
saving item work fine; either use aceheart sample or edit his example i did it and it work fine.
http://img175.imageshack.us/i/look.jpg/

I really have tried. A lot. I've changed everything I can possibly think of, but to no avail. I really think it just doesn't want to work on my map. I'll post the current code here.

Trigger:
  • SaveLoad Initialization Hero
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- List of Heroes --------
      • Set SaveLoad_Heroes[1] = Villager [ Agile ]
      • Set SaveLoad_Heroes[2] = Villager [ Smart ]
      • Set SaveLoad_Heroes[3] = Villager [ Strong ]
      • Set SaveLoad_Heroes[4] = Villager [ Agile ]
      • Set SaveLoad_Heroes[5] = Villager [ Smart ]
      • Set SaveLoad_Heroes[6] = Villager [ Strong ]
      • -------- Number of Heroes --------
      • Set SaveLoad_Heroes_LastIndex = 6
      • -------- List of Items --------
      • Set SaveLoad_Items[1] = Mortar and Pestle
      • Set SaveLoad_Items[2] = Lockpick
      • Set SaveLoad_Items[3] = Pruners
      • Set SaveLoad_Items[4] = Bronze Axe
      • Set SaveLoad_Items[5] = Getting Started - An Instructional Guide
      • -------- Number of Items --------
      • Set SaveLoad_Items_LastIndex = 6
      • -------- List of Abilities --------
      • Set SaveLoad_Abilities[1] = Acid Bomb
      • -------- Number of Abilities --------
      • Set SaveLoad_Abilities_LastIndex = 1
      • -------- These three lines may be changed if needed --------
      • Set SaveLoad_Alphabet = ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
      • Set SaveLoad_CaseSensitive = False
      • Set SaveLoad_UsePlayername = False
      • -------- Required: false --------
      • Set SaveLoad_Initialized = False
      • -------- Leave as is. Used to autocreate variables when copy & pasting to a new map --------
      • Set Code = AceHart
      • Set Save[1] = 0
      • Set SaveCount = 1
      • Set Validate = False
      • Set SaveLoad_Compress[1] = 0
      • Set SaveLoad_Uncompress[1] = 0


Trigger:
  • SaveLoad Save Hero
    • Events
      • Player - Player 1 (Red) types a chat message containing -save as An exact match
      • Player - Player 2 (Blue) types a chat message containing -save as An exact match
      • Player - Player 3 (Teal) types a chat message containing -save as An exact match
      • Player - Player 4 (Purple) types a chat message containing -save as An exact match
      • Player - Player 5 (Yellow) types a chat message containing -save as An exact match
      • Player - Player 6 (Orange) types a chat message containing -save as An exact match
      • Player - Player 7 (Green) types a chat message containing -save as An exact match
      • Player - Player 8 (Pink) types a chat message containing -save as An exact match
      • Player - Player 9 (Gray) types a chat message containing -save as An exact match
      • Player - Player 10 (Light Blue) types a chat message containing -save as An exact match
    • Conditions
    • Actions
      • -------- Prepare the save array with this player's Hero --------
      • Set SaveCount = 0
      • -------- Take all Heroes (assumes there is only one) --------
      • Unit Group - Pick every unit in (Units owned by (Triggering player) matching (((Matching unit) is A Hero) Equal to True)) and do (Actions)
        • Loop - Actions
          • -------- Save the Hero --------
          • Set SaveCount = (SaveCount + 1)
          • Set TempUnit = (Picked unit)
          • Custom script: set udg_Save[udg_SaveCount] = SaveLoad_Unit2Integer( udg_TempUnit )
          • -------- Hero level --------
          • Set SaveCount = (SaveCount + 1)
          • Set Save[SaveCount] = (Hero level of (Picked unit))
          • -------- Gold --------
          • Set SaveCount = (SaveCount + 1)
          • Set Save[SaveCount] = ((Triggering player) Current gold)
          • -------- Save Skills --------
          • -------- Alchemy --------
          • Set SaveCount = (SaveCount + 1)
          • Set Save[SaveCount] = Alchemy_Level[(Player number of (Triggering player))]
          • -------- Gardening --------
          • Set SaveCount = (SaveCount + 1)
          • Set Save[SaveCount] = Gardening_Level[(Player number of (Triggering player))]
          • -------- Magic --------
          • Set SaveCount = (SaveCount + 1)
          • Set Save[SaveCount] = Magic_Level[(Player number of (Triggering player))]
          • -------- Security --------
          • Set SaveCount = (SaveCount + 1)
          • Set Save[SaveCount] = Security_Level[(Player number of (Triggering player))]
          • -------- Woodcutting --------
          • Set SaveCount = (SaveCount + 1)
          • Set Save[SaveCount] = Woodcutting_Level[(Player number of (Triggering player))]
          • -------- How many items does he carry --------
          • Set SaveCount = (SaveCount + 1)
          • Set Save[SaveCount] = (Number of items carried by (Picked unit))
          • For each (Integer A) from 1 to 6, do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Item carried by (Picked unit) in slot (Integer A)) is owned) Equal to True
                • Then - Actions
                  • -------- The actual item --------
                  • Set SaveCount = (SaveCount + 1)
                  • Set TempItem = (Item carried by (Picked unit) in slot (Integer A))
                  • Custom script: set udg_Save[udg_SaveCount] = SaveLoad_Item2Integer( udg_TempItem )
                  • -------- The number of charges it has --------
                  • Set SaveCount = (SaveCount + 1)
                  • Set Save[SaveCount] = (Charges remaining in (Item carried by (Picked unit) in slot (Integer A)))
                • Else - Actions
      • -------- Turn values into code --------
      • Custom script: set udg_Code = SaveLoad_Encode()
      • -------- Show code to player --------
      • Quest - Display to (Player group((Triggering player))) the Secret message: Your code:
      • Game - Display to (Player group((Triggering player))) for 60.00 seconds the text: Code
      • Game - Display to (Player group((Triggering player))) for 60.00 seconds the text:


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
      • Player - Player 5 (Yellow) types a chat message containing -load as A substring
      • Player - Player 6 (Orange) types a chat message containing -load as A substring
      • Player - Player 7 (Green) types a chat message containing -load as A substring
      • Player - Player 8 (Pink) types a chat message containing -load as A substring
      • Player - Player 9 (Gray) types a chat message containing -load as A substring
      • Player - Player 10 (Light Blue) 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
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Hero[(Player number of (Triggering player))] Equal to No unit
        • Then - Actions
        • Else - Actions
          • Game - Display to (Player group((Triggering player))) the text: You already have a ...
          • Skip remaining 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 --------
      • Unit Group - Pick every unit in (Units owned by (Triggering player) of type Hero Selection) and do (Actions)
        • Loop - Actions
          • Unit - Remove (Picked unit) from the game
      • Unit Group - Pick every unit in (Units owned by (Triggering player) matching (((Matching unit) is A Hero) Equal to True)) and do (Actions)
        • Loop - Actions
          • Unit - Remove (Picked unit) from the game
      • Set SaveCount = 1
      • Custom script: set udg_TempUnitType = SaveLoad_Integer2Unit(udg_Save[udg_SaveCount])
      • Unit - Create 1 TempUnitType for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
      • Set Hero[(Player number of (Triggering player))] = (Last created unit)
      • Set SaveCount = (SaveCount + 1)
      • Hero - Set (Last created unit) Hero-level to Save[SaveCount], Hide level-up graphics
      • Set SaveCount = (SaveCount + 1)
      • Player - Set (Triggering player) Current gold to Save[SaveCount]
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering player) Current gold) Less than 32
        • Then - Actions
          • Player - Set (Triggering player) Current gold to 32
        • Else - Actions
      • -------- Alchemy --------
      • Set SaveCount = (SaveCount + 1)
      • Set Alchemy_Level[(Player number of (Triggering player))] = Save[SaveCount]
      • -------- Gardening --------
      • Set SaveCount = (SaveCount + 1)
      • Set Gardening_Level[(Player number of (Triggering player))] = Save[SaveCount]
      • -------- Magic --------
      • Set SaveCount = (SaveCount + 1)
      • Set TempLoader = (Triggering player)
      • For each (Integer A) from 1 to Save[SaveCount], do (Actions)
        • Loop - Actions
          • Set Magic_Level[(Player number of (Triggering player))] = (Integer A)
          • Trigger - Run Magiccheck <gen> (ignoring conditions)
      • -------- Security --------
      • Set SaveCount = (SaveCount + 1)
      • Set Security_Level[(Player number of (Triggering player))] = Save[SaveCount]
      • -------- Woodcutting --------
      • Set SaveCount = (SaveCount + 1)
      • Set Woodcutting_Level[(Player number of (Triggering player))] = Save[SaveCount]
      • Set SaveCount = (SaveCount + 1)
      • For each (Integer A) from 1 to Save[SaveCount], do (Actions)
        • Loop - Actions
          • Set SaveCount = (SaveCount + 1)
          • Custom script: set udg_TempItemType = SaveLoad_Integer2Item(udg_Save[udg_SaveCount])
          • Hero - Create TempItemType and give it to (Last created unit)
          • Set SaveCount = (SaveCount + 1)
          • Item - Set charges remaining in (Last created item) to Save[SaveCount]


It seems to be random on how many things save depending on the first item in my inventory. Items with charges seem to mess it up, but removing the charge saving doesn't seem to make a difference.
 

Yoshii

New Member
Reaction score
74
I didindt personaly do the charge thing as I didnt see the need so I removed; the save part of your code looks fine but the load part does not
Trigger:
  • Set SaveLoad_Items_LastIndex = 6

this should be =5 you only have 5 item in the list
 

Yoshii

New Member
Reaction score
74
Trigger:
  • SaveLoad Load Hero
    • For each (Integer A) from 1 to Save[SaveCount], do (Actions)
      • Loop - Actions
        • Set SaveCount = (SaveCount + 1)
        • Custom script: set udg_TempItemType = SaveLoad_Integer2Item(udg_Save[udg_SaveCount])
        • Hero - Create TempItemType and give it to (Last created unit)
        • Set SaveCount = (SaveCount + 1)
        • Item - Set charges remaining in (Last created item) to Save[SaveCount]
try For each integer A from 0 to save[9] as save[9] is where the number of item is stored for you
if you have 2 item item then save[9]=2 then it get converted from the 5 possible item in the itemlist in the save initialization
if you pick up say 2 item then save[9]=2 (saved)
you then load
the game will loop from 0 to 2 and should give you your 2 item ( i myself use save[4] and the above in my map cause I save 4 thing)
At first I was trying loop from 1 to save[4] in my map but it was always missing an item somehow or doing weird stuff and now it work fine with 0.
edit: i meant to edit my last post
 

Denegoth

New Member
Reaction score
18
try For each integer A from 0 to save[9] as save[9] is where the number of item is stored for you
if you have 2 item item then save[9]=2 then it get converted from the 5 possible item in the itemlist in the save initialization
if you pick up say 2 item then save[9]=2 (saved)
you then load
the game will loop from 0 to 2 and should give you your 2 item ( i myself use save[4] and the above in my map cause I save 4 thing)
At first I was trying loop from 1 to save[4] in my map but it was always missing an item somehow or doing weird stuff and now it work fine with 0.
edit: i meant to edit my last post

Just changed everything you said to, it's not working. It's really starting to annoy me. I think it just doesn't want to work on my map.
 

Samael88

Evil always finds a way
Reaction score
181
Try adding some debug messages to the code.

Like display the names of the temp item, and a few just to see if it fires the ifs and everything.

That way you can easier locate the problem. I can't find any right now tho.
 
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