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

Couple Hard JASS Questions

Status
Not open for further replies.
Level 7
Joined
Jul 3, 2011
Messages
251
Hey guys, as the title says i have a couple of hard JASS questions, some are related to hosting bots but are more code sided (or so i think anyway)

First, how does HCL actually work? I know what it does and that it does it by handicap, but how is each player assigned a specific handicap by a letter?

Second, does anyone have a link to w3mmd code? Is w3mmd possible to do in normal JASS? Ive only seen it done in vJASS but to my knowledge the compliler compiles vJASS into ordinary JASS, no? And how w3mmd actually work?

Third, once we have HCL set up and working correctly, how can we see if the HCL contains 2 game modes that dont work with eachother? An example is HCL in DotA "apsd" since all pick and single draft cancel eachother out, none will be entered, i thought about this and the only way i can think this would be achieved is by checking every 2 letters to see if they contain those letters, however i am unsure how to check if 2 game modes have been entered in the same string without a tonne of if/then/else statements, so how can this be done efficiently?

Fouth, how can i create an ability that will make the user perm invis no matter what, even if he casts spells? And dont say spam invisability cast on him please, i need something that wont even reveal him for a split second, like shadow dance from slark in DotA.

Fith, can someone explain to me fully what the debug code is, what it does and how it can be used?

Will rep for any usefull help.

If you post code to help, please make it JASS, i dont understand vJASS yet.
 
Last edited:
When you're talking about Game Modes, my 'Mode Manager' would be perfect.
If you'd read below the code, you'd see how you could use the flag boolean to stop certain modes from being canceled out :p
If you enter -apsd for example, with this system, it would only count ap if you'd use the boolean right :)
-apomsd will only count ap and om
-sdapom will only count sd and om

Game commands work differently:
-ms
-ma
-msma (Would only run ms and ignore ma)

Sounds good? :)

It depends on the user configuration though.
Make use of the flag boolean ;)
 
Level 8
Joined
Apr 26, 2011
Messages
403
How to HCL work?
- in game lobby (where you waiting for more player join before start), there are player's HP % setting. it call "handicap"
- Hostbot change this handicap % use certain rules (convert letters to %)
- after game start, Hostbot read handicap by same rules (convert % to letter)
- due to limitation on "convert rules", each % can only convert to 1 letter
- so it you have 8 players, it can only "hold" 8 character's string (include computer player)

Warning: if your map do not support HCL, then Hostbot will become cheat program (it can modified player's HP.

eg, if unit have 1000 hp, a mistake hcl command can changed your unit's hp to 2000. (that is why you need HCL code to restore handicap back to normal)
 
Last edited:
Level 7
Joined
Jul 3, 2011
Messages
251
ok thanks but i already knew how to make HCL, it was w3mmd code i was requesting in JASS, but thanks for answering the other questions.

also, where you put
5, in your mode trigger, check if command is empty. if it is not then use command as string. and turn off trigger that take string from player.

I know about that, but how can i see if the string contains 2 invalid codes? Say my map will have at least 10 different game modes that will conflict with eachother, how can i make it so if one of those is entered the others are disabled? (Please dont say to check the string and disable triggers) I need a way to filter out the string for specific letters, if 2 invalid game modes are found, i want no mode to be entered instead of the first typed game mode.
 
Level 8
Joined
Apr 26, 2011
Messages
403
ok thanks but i already knew how to make HCL, it was w3mmd code i was requesting in JASS, but thanks for answering the other questions.

also, where you put

I know about that, but how can i see if the string contains 2 invalid codes? Say my map will have at least 10 different game modes that will conflict with eachother, how can i make it so if one of those is entered the others are disabled? (Please dont say to check the string and disable triggers) I need a way to filter out the string for specific letters, if 2 invalid game modes are found, i want no mode to be entered instead of the first typed game mode.

before adding HCL. you already have your own rules to check for input string right ? so you can use same rules.

1,
in your initial trigger, do follow:
excute trigger : "trigger-- read HCL command"
if (udg_command != null) then
excute trigger : "Trigger -- HCL mode"


2,

Trigger -- player enter mode
Event-- player(1) enter blah blah
Condition -- blah blah (your own rules)
Action --
set temp_string = read player enter string
blah blah blah for handle player's enter string

then, just copy above trigger:
Trigger -- HCL mode
Event -- (empty)
Condition -- (empty)
Action--
set temp_string = udg_command
blah blah blah same as above trigger, but add those two line at the end:
trigger-- turn off "Trigger -- player enter mode" // only call this line if mode is valid.
trigger-- turn off this trigger
 
Last edited:
Level 7
Joined
Jul 3, 2011
Messages
251
How would that work? I need a way to actually filter the string for groups of letters, say a mode entered was apsd, how can i make it so no mode is entered without a tonne of if/then/elseifs or registering every possible invalid game mode collision?
 
Level 8
Joined
Apr 26, 2011
Messages
403
I though this is not relate to HCL anymore ?

if your mode work without HCL, then you can use same code for HCL

but here is how to check for invalid mode:

for example, if you have mode:

aa
bb
cc
dd
ee
ff.

Code:
inside your trigger, you can check :
temp_index = length of string enter
loop: from 0 to temp_index-1
  temp_string = substring of Enter_String (loop_a*2, loop_A +1) //pick up every 2 letter from mode
  if temp_string == "aa" then
     mode_aa = true
  elseif temp_string == "bb" then
     mode_bb = true
  elseif
     mode cc, dd, ee, ff
  else
     invalid_mode = invalid_mode + 1// if mode doesn't match any of above
  
end loop

if invalid_mode <2 then
  trigger-run "valid-mode trigger"
  trigger-turn off this trigger
else
  set mode_aa, bb, cc, dd, ee,ff = false
  send message to player "invalid mode, please try again"
 
Status
Not open for further replies.
Top