| 08-09-2005, 11:03 AM | #1 | |
Quote:
Ahem, this is a horrible piece of script, but oh well. All I did basically was copy and paste some converted text. What I'm attempting to do is create a variable that I can use for a few more functions, then remove it. Normally I would just use a Global but I have to be able to have 9 of these 'tempWeapon' variables for each player. Thanks. |
| 08-10-2005, 01:21 PM | #2 |
[quote] // Add this function in front of the other one function ConditionInAFunction takes nothing returns boolean return GetUnitTypeId(GetFilterUnit()) == 'e001' endfunction // At top of function local unit tempWeapon set tempWeapon = GroupPickRandomUnit(GetUnitsInRangeOfLocMatching(70.00,GetUnitLoc(udg_Hero[GetForLoopIndexA()]), Condition(ConditionInAFunction))) |
| 08-10-2005, 07:01 PM | #3 | |
Quote:
Somthing must be wrong with that, I get warning for 'endif's for the first 4 lines, and a 'Expected name' for the final line. |
| 08-10-2005, 08:05 PM | #4 |
What the heck are you doing? cause it seems you are inserting a function inside a gui trigger, please learn JASS the real way. |
| 08-10-2005, 09:14 PM | #5 |
I dont know JASS, I was just following what Zoxc suggested. |
| 08-10-2005, 11:19 PM | #6 |
Well you said you converted the trigger into JASS......... |
| 08-10-2005, 11:23 PM | #7 | |
Not really, Quote:
|
| 08-11-2005, 10:51 AM | #8 | ||||
If youre using GUI you need to do this: // Add this global script ( The trigger with the map name ) Quote:
// At top of the trigger Quote:
// Then this where you want it Quote:
// At end of trigger Quote:
Locals can only be used in the function its created in. It can't be used in conditions except custom script coditions. And Pick All Actions, cuz WE or creating a new function for that. |
| 08-11-2005, 01:01 PM | #9 | |
![]() Lovely little Error list. Here is what my trigger looks like; Quote:
Once it works I'll replace all of those 'Random unit from..' with tempWeapon. Also, this If/Then/Else is one of 9 in this trigger, checking for 9 different unit types. |
| 08-11-2005, 04:18 PM | #10 | |
Please do what I say: Quote:
|
| 08-12-2005, 12:25 PM | #11 |
Yes, however this runs in a loop every .05 seconds and the local might be needed for all 9 If/Then/Else functions at the same time. If I place the scripts in those locations will it still work properly? |
