- Joined
- May 19, 2010
- Messages
- 34
Hey guys, I'm just starting to learn JASS and whilst there are lots of good tutorials out there for beginners there are still many things I don't understand. THe main principle is how can you use JASS to edit specific values that aren't easily accessed or accessable at all via GUI triggers.
More specifically, I was trying to make a simple in-game addition calculator as practice. That is, when a player typed a message containing the addition of two integers (so a+b, where a,b are integers) a message would be displayed showing the result. However the only in-game 'Action' in terms of chat messages that players type were things like "if they type String 1 + String2" and it had to be an exact match or a substring. So how would I make it so that they can type ANY value there and then I can set those values to a local variable or the like. So if they typed 4+8 is it possible to set 4=a, 8=b then add them together and display the result through JASS? I can manage to add them, it's just converting them to variables to start off with that I can't work out. And also, is that a good way to go about what I'm trying to do?
And secondly, how can I access other in-game values? For example, in a function which involved say dealing damage based on a unit's intelligence (or whatever, there are plenty of different examples) how can I set a local variable to equal a hero's intelligence. Like:
function Trig_IntAttack_Actions takes nothing returns nothing
local integer a = ???
Firstly, CAN I do it that way, and if so how? I mean I'm generally wondering how you type out those kinds of values in JASS, like unit's movement speed, movement height, stats, life/mana etc..
Sorry if my questions seem stupid or completely wrong, I'm brand new to JASS and any kind of programming
and starting off is the hardest of all. I'm just trying to get a hold of some basic concepts so I can build on them.
Thanks for anyone who helps, it's greatly appreciated
!!!
More specifically, I was trying to make a simple in-game addition calculator as practice. That is, when a player typed a message containing the addition of two integers (so a+b, where a,b are integers) a message would be displayed showing the result. However the only in-game 'Action' in terms of chat messages that players type were things like "if they type String 1 + String2" and it had to be an exact match or a substring. So how would I make it so that they can type ANY value there and then I can set those values to a local variable or the like. So if they typed 4+8 is it possible to set 4=a, 8=b then add them together and display the result through JASS? I can manage to add them, it's just converting them to variables to start off with that I can't work out. And also, is that a good way to go about what I'm trying to do?
And secondly, how can I access other in-game values? For example, in a function which involved say dealing damage based on a unit's intelligence (or whatever, there are plenty of different examples) how can I set a local variable to equal a hero's intelligence. Like:
function Trig_IntAttack_Actions takes nothing returns nothing
local integer a = ???
Firstly, CAN I do it that way, and if so how? I mean I'm generally wondering how you type out those kinds of values in JASS, like unit's movement speed, movement height, stats, life/mana etc..
Sorry if my questions seem stupid or completely wrong, I'm brand new to JASS and any kind of programming
Thanks for anyone who helps, it's greatly appreciated
