| 01-21-2006, 02:09 PM | #1 |
JASS:call UnitDamageTargetBJ( c, t, 500.00, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_FIRE ) how do I make it non BJ? I tried to just remove the BJ but that didnt work. (as you probably suspect Im really new to JASS) |
| 01-21-2006, 02:10 PM | #2 |
JASS:native UnitDamageTarget takes unit whichUnit, widget target, real amount, boolean attack, boolean ranged, attacktype attackType, damagetype damageType, weapontype weaponType returns boolean JASS:function UnitDamageTargetBJ takes unit whichUnit, unit target, real amount, attacktype whichAttack, damagetype whichDamage returns boolean return UnitDamageTarget(whichUnit, target, amount, true, false, whichAttack, whichDamage, WEAPON_TYPE_WHOKNOWS) endfunction figure it out from there. (jass shop pro is your friend.) edit: FYI: BJ functions are esentally functions made to make the GUI editor look and work nicer. they serve no real purpose allot of the time. |
| 01-21-2006, 02:19 PM | #3 |
So what's is fastest? BJ or not BJ? not BJ seems like more work. |
| 01-21-2006, 02:21 PM | #4 |
all the BJ doas is call the native (non-bj) with some of the paramiters set to pre-defined values. making a function non-bj just for the sake of it (when you would use the same paramiters as a BJ function) is dumb. (this is presuming its a BJ function like this one, that just fills in some of the values for you.) (and by dumb i mean time wasting. it will improve your code slightly. but if you are able to notice the milisecont, then do what you think best.) |
| 01-21-2006, 02:31 PM | #5 |
Well I dont really care if its 0.1 sec faster, aslong as It doesnt leak. Just wondered the difference. (sry for being stupid but I'm really really new to JASS, this is the first JASS spell Im making and still there is some GUI involved :P, Im not new to WE, just new to JASS) Also whats wrong with this? call ModifyHeroSkillPoints( t, bj_MODIFYMETHOD_SUB, ( ( ( 8 + R2Ie ) / 10 ) - ( R2Ir / 10 ) ) ) e and r are local integers, I could make them local integer r=R2I(*****) but that messed up so I didnt use it. |
| 01-21-2006, 02:35 PM | #6 | |
Quote:
its ok not to know everything (unless your me. then you have no excusse.)the stupidity of BJ functions still eludes even me... (which i am ever shamed for.) and leaks are caused by creating things that are never destroyed. (unit groups, forces, ext.) |
| 01-21-2006, 02:38 PM | #7 |
yaeh I know how to clear leaks and what things that leaks. could you help me with the other problem? call ModifyHeroSkillPoints( t, bj_MODIFYMETHOD_SUB, ( ( ( 8 + R2Ie ) / 10 ) - ( R2Ir / 10 ) ) ) e and r are local integers, t is a local unit. I could make them: local integer r=R2I(*****) instead, but that messed the it up so I didnt use it. |
| 01-21-2006, 02:46 PM | #8 |
JASS:call ModifyHeroSkillPoints( t, bj_MODIFYMETHOD_SUB, ( ( ( 8 + R2Ie ) / 10 ) - ( R2Ir / 10 ) ) ) your R2I's are missing their brackets and im pretty shure you cant define locals with functions as values :) (i may be wrong. im no JASS guru myself) what are you trying to acheve with this? |
| 01-21-2006, 02:50 PM | #9 |
brackets = ? Well correct me if im wrong. When you make a spell and set the units to globals, you cant make it multiinstability without arrays(atleast not in a easy way) But if you set them to locals in a trigger, it will be MUI, I might be wrong though. From what Ive understood each time the trigger runs it makes a local local :P. so local c the first time the trigger runs isnt the same as local c the second time. |
| 01-21-2006, 03:04 PM | #10 |
a local is a variable that is local to a function. If you set a local "I", then set its value to "5" if "udg_bool" is true, then set "udg_bool" to false, the next call to that function would not set the value of "I" to 5. Brackets are these: (), eg: I2S(var) multi-instanceability is best achived thru a game cache. (and some verry complicated stuff i wont get into now) now, for most "basic" triggerd spells, you can use global variable arrays. i need sleep... |
| 01-21-2006, 03:18 PM | #12 | |
Quote:
First of all, if they are integers you don't need the R2I() anyway, it just won't work. Second, if you don't have a definition at the beginning of your function for the integers like "local integer r = R2I([real])" you can't use them. Finally, as Earth-Fury said, when you use a function like R2I() you need to include the parameters in the parentheses. In your case, assuming that e and r are reals you'd want to put them here: call ModifyHeroSkillPoints( t, bj_MODIFYMETHOD_SUB, ( ( ( 8 + R2I(e) ) / 10 ) - ( R2I(r) / 10 ) ) ) If e and r are integers all you need to do is: call ModifyHeroSkillPoints( t, bj_MODIFYMETHOD_SUB, ( ( ( 8 + e ) / 10 ) - ( r / 10 ) ) ) |
| 01-21-2006, 03:26 PM | #13 |
Ok I just saw that Ive posted the wrong function :/ It isnt ModifySkillPoint, Its ModifyHeroStat. JASS:
call ModifyHeroStat( bj_HEROSTAT_INT, targ, bj_MODIFYMETHOD_SUB, ( ( ( 8 + R2I(eva) ) / 10 ) - ( R2I(res) / 10 ) ) ) doesnt work. |
| 01-21-2006, 04:05 PM | #14 |
Are you sure that's the line that's getting the error? It appears that you might be missing a ')' on the end although I'm not sure... If that doesn't work try this: call ModifyHeroStat( 2, targ, 1, 10 ) |
