wc3campaigns
WC3C Homepage - www.wc3c.netUser Control Panel (Requires Log-In)Engage in discussions with other users and join contests in the WC3C forums!Read one of our many tutorials, ranging in difficulty from beginner to advanced!Show off your artistic talents in the WC3C Gallery!Download quality models, textures, spells (vJASS/JASS), systems, and scripts!Download maps that have passed through our rigorous approval process!

Go Back   Wc3C.net > Warcraft III Modding > Developer's Corner > Triggers & Scripts
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 03-26-2009, 04:56 AM   #1
Blacktastic
User
 
Blacktastic's Avatar
 
Join Date: Oct 2006
Posts: 138

Blacktastic is on a distinguished road (12)

Default Threat System (Unit Group Question)

Problems fixed so far. Waiting for more questions to arise.

Expand JASS:
__________________
lolwut

Last edited by Blacktastic : 03-27-2009 at 08:25 AM.
Blacktastic is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 03-27-2009, 06:51 AM   #2
Jazradel
Superuser
 
Jazradel's Avatar
 
Join Date: Dec 2005
Posts: 651

Submissions (1)

Jazradel has a spectacular aura about (110)Jazradel has a spectacular aura about (110)Jazradel has a spectacular aura about (110)Jazradel has a spectacular aura about (110)

Send a message via AIM to Jazradel Send a message via MSN to Jazradel
Default

This is a rough example, I didn't look that closely at your code so I haven't put in references to all your variables, or how you pass data.
Collapse JASS:
globals //don't need these globals, can pass using Tables or w/e
   integer Count
   integer HealedValue
endglobals

local group g = CreateGroup()
set Count = 0
call GroupEnumUnits(g, 800, x, y, Condition(function Count)) //forgotten the exact syntax, but easy to check
set HealedValue = //whatever it was, can't be bothered checking
call ForGroup(g, function Enum)
call DestroyGroup()

function Count takes nothing returns boolean //this is called by GroupEnumUnits, once for each unit that is within the 800
    set Count = Count + 1
    return true //if it returns false, then the GetFilterUnit() is excluded from the group
endfunction

function Enum takes nothing returns nothing //and this is called by ForGroup(), for each unit that has passed whatever check you have in count, and is now in the group g.
    local unit u = GetEnumUnit()
    set u.struct.threat =  u.struct.threat 0.5 * Healed Value / Count //not sure how you need 
endfunction
__________________


Table:
Jump Map
Point System
Warcraft III Model Archive

W3 Model Archive should be available from https://www.mediafire.com/folder/cd5..._III_Resources, PM me if it doesn't work.

Last edited by Jazradel : 03-27-2009 at 06:59 AM.
Jazradel is offline   Reply With Quote
Old 03-27-2009, 08:22 AM   #3
Blacktastic
User
 
Blacktastic's Avatar
 
Join Date: Oct 2006
Posts: 138

Blacktastic is on a distinguished road (12)

Default

Thanks for the help, got my question answered though. Keeping this thread open for future questions I am sure I will have though. (Edit ftw)
__________________
lolwut
Blacktastic is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT. The time now is 09:38 PM.


Affiliates
The Hubb The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

Powered by vBulletin (Copyright ©2000 - 2019, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services