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

W3mmd

Status
Not open for further replies.
Level 6
Joined
Feb 10, 2011
Messages
188
Hello, I am trying to use the W3MMD for my Map that has gained popularity on RoC.

So far I have
Set Up My SQL Data Base
Made the bot communicate with the data base, It currently tracks the default stuff.
I changed my map CFG to a W3MMD map
I Implemented the W3MMD script into my map.

What do I need to do now?
Do I have to Edit the bot in any way?
What are the custom scripts I can use to store the integers that the bot will read?

Please, dont tell me to go to codelain I looked already.
 
As far as the custom scripts go, I've seen DefineValue and UpdateValue<Type> to be the primary functions for saving data.

JASS:
public function DefineValue takes string name, integer value_type, integer goal_type, integer suggestion_type returns nothing
On initialization, you would call that to define any values you will save throughout the game.
  • string name - data variable/identifier/name
  • integer value_type - type of data to save: MMD_TYPE_STRING, MMD_TYPE_INT, or MMD_TYPE_REAL.
  • integer goal_type - either GOAL_NONE, GOAL_HIGH, or GOAL_LOW. Apparently it is the sort order of the data variable. I personally don't know what it means.
  • integer suggestion_type - either SUGGEST_TRACK, SUGGEST_TRACK, or SUGGEST_LEADERBOARD. Apparently it is "a suggestion for what the parser should do for tracking the value". Again, I don't know how it applies.

Ex:
JASS:
call DefineValue("kills", MMD_TYPE_INT, GOAL_HIGH, SUGGEST_LEADERBOARD)

You would define all the values/variables on initialization. When you need to update a value, you simply use UpdateValueInt, UpdateValueString, or UpdateValueReal.
JASS:
public function UpdateValueInt takes string name, player p, integer op, integer value returns nothing
  • string name - name of the data/variable/identifier
  • player p - which player's data to update
  • integer op - either OP_ADD, OP_SUB, OP_SET. add = adds to the current value of that data, sub = subtract, set = set the value.
  • integer value - the data will now hold this value.

Ex:
JASS:
call UpdateValueInt("kills", Player(0), OP_ADD, 1)
Make sure that you only update values that you have defined already (through DefineValue()). And make sure you choose the right type. If you want to update a string, use UpdateValueString instead of UpdateValueInt. Same for the type real.

This is a good thread to read up on, especially the last post:
http://www.hiveworkshop.com/forums/triggers-scripts-269/w3mmd-desyncs-204426/
It has some nice examples that you may be able to work off too (although, I'm sure you already looked at that thread).
 
Level 6
Joined
Feb 10, 2011
Messages
188
Wow, I dont really get jass and so far I get it. You should make a tutorial lol

+rep

Thank you a ton.

And, yes that was one of the threads that google gave me :p I wish that link in the 3rd to last post worked.
 
Last edited:
Status
Not open for further replies.
Top