[Log in / Register]
| News | Chat | Pastebin | Donations | Tutorials | Rules | Forums | Starcraft II |
| Maps | Skins | Icons | Models | Spells | Tools | Jass | Packs |
(Keeps Hive Alive)
Go Back   The Hive Workshop > Warcraft III Modding > World Editor Help Zone

World Editor Help Zone Need help with Blizzard's World Editor? Ask general questions about its features and use in this forum. README!

Closed Thread
 
LinkBack Thread Tools
Old 07-04-2009, 09:42 PM   #1 (permalink)
Registered User FriXionX
User Pooner
 
FriXionX's Avatar
 
Join Date: Aug 2008
Posts: 384
FriXionX has little to show at this moment (32)FriXionX has little to show at this moment (32)FriXionX has little to show at this moment (32)FriXionX has little to show at this moment (32)
Can you remove an array without doing multiple functions?

Say if i had something like this... (example)

Set TempGroup[1] = (Units owned by (Player 1 (Red)
Set TempGroup[2] = (Units owned by (Player 2 (Blue)
Set TempGroup[3] = (Units owned by (Player 3 (Teal)

Do i have to do
Custom script: call DestroyGroup(TempGroup[1])
Custom script: call DestroyGroup(TempGroup[2])
Custom script: call DestroyGroup(TempGroup[3])

Or can i just do one function, that removes them all, to shorten it?
__________________

whaer is mai narutard spellpaxz
+Rep if i halp pl0x.
FriXionX is offline  
Old 07-04-2009, 11:11 PM   #2 (permalink)
Registered User toofless
User
 
toofless's Avatar
 
Join Date: Nov 2008
Posts: 459
toofless has little to show at this moment (50)
You need an integer, let's call it x for now.

set x = 0
Custom Script: loop
Custom Script: exitwhen x == 4 //thats the max number of times you want it to loop +1
Custom Script: call DestroyGroup(TempGroup[x])
set x = x + 1
Custom Script: endloop

I believe that will work.
__________________

--==THE SUPER FLYING MONKEY NINJAS==--
They WILL rule the world
toofless is offline  
Old 07-04-2009, 11:30 PM   #3 (permalink)
Registered User Linaze
...
 
Linaze's Avatar
 
Join Date: Feb 2007
Posts: 2,229
Linaze is just really nice (337)Linaze is just really nice (337)Linaze is just really nice (337)
Former Staff Member: This user used to be on the Hive Workshop staff. 
Or in Jass:
Jass:
local integer i = 0
loop
   exitwhen i == 2
   call DestroyGroup(TempGroup[x])
   i = i + 1
endloop
Linaze is offline  
Old 07-04-2009, 11:33 PM   #4 (permalink)
Registered User FriXionX
User Pooner
 
FriXionX's Avatar
 
Join Date: Aug 2008
Posts: 384
FriXionX has little to show at this moment (32)FriXionX has little to show at this moment (32)FriXionX has little to show at this moment (32)FriXionX has little to show at this moment (32)
Ok, thats just too confusing. I think ill just stick with removing them normally. Thanks anyway, +rep to both..
__________________

whaer is mai narutard spellpaxz
+Rep if i halp pl0x.
FriXionX is offline  
Old 07-04-2009, 11:33 PM   #5 (permalink)
Registered User toofless
User
 
toofless's Avatar
 
Join Date: Nov 2008
Posts: 459
toofless has little to show at this moment (50)
Lol that's basicly the same except you suddenly used x instead of i xDDDDD

Anyway, don't let the Jass confuse you. Just copy it into some custom scripts and it works for you.
__________________

--==THE SUPER FLYING MONKEY NINJAS==--
They WILL rule the world
toofless is offline  
Old 07-04-2009, 11:37 PM   #6 (permalink)
Registered User FriXionX
User Pooner
 
FriXionX's Avatar
 
Join Date: Aug 2008
Posts: 384
FriXionX has little to show at this moment (32)FriXionX has little to show at this moment (32)FriXionX has little to show at this moment (32)FriXionX has little to show at this moment (32)
So uh where would i copy that Jass script?
__________________

whaer is mai narutard spellpaxz
+Rep if i halp pl0x.
FriXionX is offline  
Old 07-04-2009, 11:37 PM   #7 (permalink)
Registered User hvo-busterkomo
'Cos I had some sense
 
Join Date: Jun 2007
Posts: 1,267
hvo-busterkomo is a jewel in the rough (238)hvo-busterkomo is a jewel in the rough (238)hvo-busterkomo is a jewel in the rough (238)
Former Staff Member: This user used to be on the Hive Workshop staff. 
You can just use an Integer A loop if you want to stick with GUI.
hvo-busterkomo is offline  
Old 07-04-2009, 11:42 PM   #8 (permalink)
Registered User toofless
User
 
toofless's Avatar
 
Join Date: Nov 2008
Posts: 459
toofless has little to show at this moment (50)
Let me rephrase it for you.

Actions
Set x = 0
Custom script: loop
Custom script: exitwhen x < 3
Custom script: call DestroyForce[x]
Set x = (x + 1)
Custom script: endloop

Integer x can be reused as long as it is instant.
__________________

--==THE SUPER FLYING MONKEY NINJAS==--
They WILL rule the world
toofless is offline  
Old 07-04-2009, 11:44 PM   #9 (permalink)
Registered User Linaze
...
 
Linaze's Avatar
 
Join Date: Feb 2007
Posts: 2,229
Linaze is just really nice (337)Linaze is just really nice (337)Linaze is just really nice (337)
Former Staff Member: This user used to be on the Hive Workshop staff. 
Quote:
Originally Posted by toofless View Post
Lol that's basicly the same except you suddenly used x instead of i xDDDDD

Anyway, don't let the Jass confuse you. Just copy it into some custom scripts and it works for you.
I did it with real Jass instead of Custom Scripts. Everyone should learn Jass anyways, it isn't hard at all.
Linaze is offline  
Old 07-04-2009, 11:45 PM   #10 (permalink)
Registered User FriXionX
User Pooner
 
FriXionX's Avatar
 
Join Date: Aug 2008
Posts: 384
FriXionX has little to show at this moment (32)FriXionX has little to show at this moment (32)FriXionX has little to show at this moment (32)FriXionX has little to show at this moment (32)
It would be easier just doing it normally if you only have 3-4 arrays though. Theres more actions doing it your ways xD
__________________

whaer is mai narutard spellpaxz
+Rep if i halp pl0x.
FriXionX is offline  
Old 07-04-2009, 11:46 PM   #11 (permalink)
Registered User toofless
User
 
toofless's Avatar
 
Join Date: Nov 2008
Posts: 459
toofless has little to show at this moment (50)
Quote:
Originally Posted by Linaze View Post
I did it with real Jass instead of Custom Scripts. Everyone should learn Jass anyways, it isn't hard at all.
Who is to say whether something is hard for one or the other?

Anyway you forgot to edit another x in your post xDDDDDDDDDD
__________________

--==THE SUPER FLYING MONKEY NINJAS==--
They WILL rule the world
toofless is offline  
Old 07-05-2009, 11:24 PM   #12 (permalink)
Registered User ALiEN95
User
 
ALiEN95's Avatar
 
Join Date: Mar 2009
Posts: 893
ALiEN95 is on a distinguished road (73)ALiEN95 is on a distinguished road (73)
Quote:
Originally Posted by FriXionX View Post
Say if i had something like this... (example)

Set TempGroup[1] = (Units owned by (Player 1 (Red)
Set TempGroup[2] = (Units owned by (Player 2 (Blue)
Set TempGroup[3] = (Units owned by (Player 3 (Teal)

Do i have to do
Custom script: call DestroyGroup(TempGroup[1])
Custom script: call DestroyGroup(TempGroup[2])
Custom script: call DestroyGroup(TempGroup[3])

Or can i just do one function, that removes them all, to shorten it?
maybe

for each integer from 1 to 4 do actions
Custom script: call DestroyGroup(TempGroup[integer A])

oh,hvo-busterkomo already said it...
ALiEN95 is offline  
Old 07-06-2009, 06:57 PM   #13 (permalink)
Registered User FriXionX
User Pooner
 
FriXionX's Avatar
 
Join Date: Aug 2008
Posts: 384
FriXionX has little to show at this moment (32)FriXionX has little to show at this moment (32)FriXionX has little to show at this moment (32)FriXionX has little to show at this moment (32)
Sadly you cant do Call DestroyGroup(Tempgroup[integer A]), comes up with an error :(

Error Pic :(


Quote:
Originally Posted by toofless View Post
Let me rephrase it for you.

Actions
Set x = 0
Custom script: loop
Custom script: exitwhen x < 3
Custom script: call DestroyForce[x]
Set x = (x + 1)
Custom script: endloop

Integer x can be reused as long as it is instant.
+ I tried that and it gives a syntax error at "call DestroyForce[x]" I even tried "call DestroyGroup[x]". It still didnt work.

Edit: I think its working. But i still got this error for some reason. Says "Undeclared Variable x" when i did declare it! Heres the picture.

Weird Error
__________________

whaer is mai narutard spellpaxz
+Rep if i halp pl0x.
FriXionX is offline  
Old 07-06-2009, 07:01 PM   #14 (permalink)
Registered User Pharaoh_
Embracing the Heka Eterni
 
Pharaoh_'s Avatar
 
Join Date: Nov 2008
Posts: 2,008
Pharaoh_ is a glorious beacon of light (541)Pharaoh_ is a glorious beacon of light (541)Pharaoh_ is a glorious beacon of light (541)Pharaoh_ is a glorious beacon of light (541)Pharaoh_ is a glorious beacon of light (541)Pharaoh_ is a glorious beacon of light (541)
call DestroyGroup (udg_Tempgroup[bj_forLoopAIndex]) is the right one.
Pharaoh_ is offline  
Old 07-06-2009, 07:10 PM   #15 (permalink)
Registered User FriXionX
User Pooner
 
FriXionX's Avatar
 
Join Date: Aug 2008
Posts: 384
FriXionX has little to show at this moment (32)FriXionX has little to show at this moment (32)FriXionX has little to show at this moment (32)FriXionX has little to show at this moment (32)
Oh, ok pharoah, ill try that in a second. I just edited my post above, can you take a quick look at that aswell?
__________________

whaer is mai narutard spellpaxz
+Rep if i halp pl0x.
FriXionX is offline  
Closed Thread

Bookmarks

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Remove Skill Point except in Multiple of 3 Orchard Triggers & Scripts 2 03-31-2009 12:24 AM
[Trigger] How does If, then, else multiple functions work? Ramsey Triggers & Scripts 8 12-21-2008 01:55 PM
[JASS] Global Functions (Reusable Functions) Tigershark Triggers & Scripts 6 05-25-2008 03:37 AM
Multiple Special Effects... How to remove them Starmaart Requests 0 12-27-2005 11:07 PM
[JASS] Sharing functions across multiple custom text triggers gnosys Triggers & Scripts 2 09-09-2004 04:50 PM

All times are GMT. The time now is 05:01 AM.






Hosting by SliceHost 
Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.1
Copyright©Ralle