wc3edit.net

United Warcraft 3 map hacking!
It is currently March 29th, 2024, 6:23 am

All times are UTC




Post new topic Reply to topic  [ 9 posts ] 
Author Message
PostPosted: May 8th, 2013, 1:15 pm 
Offline
Forum Addict

Joined: February 25th, 2011, 3:16 am
Posts: 462
Location: Unknown
I want to create region then pick every item in region and do action Remove.
Here my code, but it's didn't work .

globals
Spoiler:
trigger cba= CreateTrigger()
rect gg_rct_Hack = Rect( -3008.0, -224.0, -2656.0, 256.0 )
location udg_TempLoc = null

endglobals
Spoiler:
function RemoveItems takes nothing returns nothing
call RemoveItem( GetLastCreatedItem() )
endfunction
function MoveRects takes nothing returns nothing
set udg_TempLoc = GetUnitLoc(GetTriggerUnit())
call MoveRectToLoc(gg_rct_Hack,udg_TempLoc)
call EnumItemsInRectBJ( gg_rct_Hack, function RemoveItems)
endfunction

function main
Spoiler:
local integer abc=0
loop
exitwhen abc>11
call TriggerRegisterPlayerChatEvent(cba,Player(abc),"-clear",false)
set abc=abc+1
endloop
call TriggerAddAction(cba,function MoveRects )


Thanks you .


Top
 Profile  
 
PostPosted: May 8th, 2013, 2:24 pm 
Offline
Forum Staff

Joined: November 3rd, 2010, 10:48 am
Posts: 1850
Location: Singapore
Title: Best Player
Since I didn't mess with those jass, I don't know what's wrong. Here are my doubts..
read starting from from function main to globals
Spoiler:
globals
trigger cba= CreateTrigger()
rect gg_rct_Hack = Rect( -3008.0, -224.0, -2656.0, 256.0 ) // why not use GetEntireMapRect()
location udg_TempLoc = null

endglobals

function RemoveItems takes nothing returns nothing
call RemoveItem( GetLastCreatedItem() )
//Remove items that are created previously, really? are they created?
endfunction
function MoveRects takes nothing returns nothing
set udg_TempLoc = GetUnitLoc(GetTriggerUnit())
//sets the temploc to player
call MoveRectToLoc(gg_rct_Hack,udg_TempLoc)
//move whatever in rect to loc
call EnumItemsInRectBJ( gg_rct_Hack, function RemoveItems)
//whatever in the full map rect are taking RemoveItems Function
endfunction

function main takes nothing returns nothing
local integer abc=0
loop
exitwhen abc>11
call TriggerRegisterPlayerChatEvent(cba,Player(abc),"-clear",false)
set abc=abc+1
endloop
call TriggerAddAction(cba,function MoveRects )
//function main looks fine, -clear triggers MoveRects function
endfunction

_________________
Request a map? Follow the rulesHERE
Request templateHERE
Please, do not PM me.
On the side note, I'm still playing vampirism speed on malaysia room, occasionally in Garena. Bcuz too lazy to find out where else I can play them.


Top
 Profile  
 
PostPosted: May 8th, 2013, 2:32 pm 
Offline
Forum Addict

Joined: February 25th, 2011, 3:16 am
Posts: 462
Location: Unknown
As u said "why not use GetEntireMapRect()" I only need region around unit not whole map.
And what are you thinking about get entire map to unit location????


Top
 Profile  
 
PostPosted: May 8th, 2013, 3:47 pm 
Offline
Super Moderator
User avatar

Joined: February 24th, 2009, 1:31 pm
Posts: 3815
Location: JEW LAND
It is quite simple actually.
Notice, that the trigger is running every time a player is writing -clear.
Thus, it means the trigger is activated by a PLAYER, not by a UNIT.
You have in your code - set udg_TempLoc = GetUnitLoc(GetTriggerUnit())
What is the triggering unit?
I think you want it to be on the picked units (notice I said units not unit)
So you will need to have the following:

function MoveRects takes nothing returns nothing
local group pickedGroup=CreateGroup() //Creating a group for the picked units
local unit pickedUnit //the first unit in the group
call GroupEnumUnitsSelected(pickedGroup,GetTriggerPlayer(),null) //insert all the picked units to the group
loop
set pickedUnit=FirstOfGroup(pickedGroup) // Picking the first unit in the group.
exitwhen haxUnit==null //end the loop if we don't have any more units
// Your code here
call GroupRemoveUnit(pickedGroup,pickedUnit) //remove the unit from the group after we have the command.
endloop
call DestroyGroup(pickedGroup)//remove leaks
set pickedGroup=null//remove leaks
set pickedUnit=null//remove leaks
endfunction

_________________
Image
Spoiler:
(02:24:09)
Code:
ChatBot: FatherSpace logs into the Chat.
(02:24:28) Lanaya: Gtfo ken.
(02:24:33) ChatBot: FatherSpace logs out of the Chat.
(02:24:40) Lanaya: Thought so. bitch.
(02:24:44) ChatBot: FatherSpace logs into the Chat.
(02:24:48) FatherSpace: Can I come back yet?
(02:24:51) Lanaya: What'd i say earlier.
(02:24:51) Lanaya: No.
(02:24:58) FatherSpace: Let's try this...
(02:25:01) ChatBot: Lanaya has been logged out (Kicked).
Code:

(14:33:51) 2Pac: Do you know what'S so funny?
(14:34:01) Lanaya: No, please show me.
(14:34:07) 2Pac: This.
(14:34:09) ChatBot: Lanaya has been logged out (Kicked).
(14:34:10) 2Pac:


Code:
(14:35:59) haxorico: No one will belive me if I say "I got this song from 2pac on MSN" lolz ^^
(14:36:02) Lanaya: lolz.
(14:36:16) 2Pac: I AIN'T DEAD FFS.
(14:36:26) 2Pac: I'm a living legend, y'now.
(14:37:17) haxorico: why is 2Pac a legend?
(14:37:28) Lanaya: He's the worse rapper evar.

Code:
(15:42:51) Lanaya: can i suck , . . .

Code:
(13:55:21) ChatBot: 2Pac rolls 1d100 and gets 1.
(13:55:21) ChatBot: haxorico rolls 1d2 and gets 2.
(13:55:27) haxorico: owned?

Code:
GeorgeMots: xplain what happens in SP. Why cant you save?
dast.-:i need play with 2 players

Code:
(21:53:08) (673237): plzplzplz, im sorry about before.
(21:53:26) FatherSpace: I'm sorry you were born.
(21:53:31) ChatBot: (673237) has been logged out (Kicked).


Code:
(10:08:02) Bartimaeus: you do know run I youtube channel for my favorite music, right?


Top
 Profile  
 
PostPosted: May 8th, 2013, 3:55 pm 
Offline
Forum Staff

Joined: November 3rd, 2010, 10:48 am
Posts: 1850
Location: Singapore
Title: Best Player
Assumed what you're asking for is something that removes everything on the floor.
Haxorico's explanation is fabulous.

_________________
Request a map? Follow the rulesHERE
Request templateHERE
Please, do not PM me.
On the side note, I'm still playing vampirism speed on malaysia room, occasionally in Garena. Bcuz too lazy to find out where else I can play them.


Top
 Profile  
 
PostPosted: May 8th, 2013, 4:33 pm 
Offline
Super Moderator
User avatar

Joined: February 24th, 2009, 1:31 pm
Posts: 3815
Location: JEW LAND
If it is for everything on the floor, no need to get the region from the picked units.
I assumed there is a radios for the unit, as you can see, I didn't have any code regarding the items.

_________________
Image
Spoiler:
(02:24:09)
Code:
ChatBot: FatherSpace logs into the Chat.
(02:24:28) Lanaya: Gtfo ken.
(02:24:33) ChatBot: FatherSpace logs out of the Chat.
(02:24:40) Lanaya: Thought so. bitch.
(02:24:44) ChatBot: FatherSpace logs into the Chat.
(02:24:48) FatherSpace: Can I come back yet?
(02:24:51) Lanaya: What'd i say earlier.
(02:24:51) Lanaya: No.
(02:24:58) FatherSpace: Let's try this...
(02:25:01) ChatBot: Lanaya has been logged out (Kicked).
Code:

(14:33:51) 2Pac: Do you know what'S so funny?
(14:34:01) Lanaya: No, please show me.
(14:34:07) 2Pac: This.
(14:34:09) ChatBot: Lanaya has been logged out (Kicked).
(14:34:10) 2Pac:


Code:
(14:35:59) haxorico: No one will belive me if I say "I got this song from 2pac on MSN" lolz ^^
(14:36:02) Lanaya: lolz.
(14:36:16) 2Pac: I AIN'T DEAD FFS.
(14:36:26) 2Pac: I'm a living legend, y'now.
(14:37:17) haxorico: why is 2Pac a legend?
(14:37:28) Lanaya: He's the worse rapper evar.

Code:
(15:42:51) Lanaya: can i suck , . . .

Code:
(13:55:21) ChatBot: 2Pac rolls 1d100 and gets 1.
(13:55:21) ChatBot: haxorico rolls 1d2 and gets 2.
(13:55:27) haxorico: owned?

Code:
GeorgeMots: xplain what happens in SP. Why cant you save?
dast.-:i need play with 2 players

Code:
(21:53:08) (673237): plzplzplz, im sorry about before.
(21:53:26) FatherSpace: I'm sorry you were born.
(21:53:31) ChatBot: (673237) has been logged out (Kicked).


Code:
(10:08:02) Bartimaeus: you do know run I youtube channel for my favorite music, right?


Top
 Profile  
 
PostPosted: May 9th, 2013, 11:16 am 
Offline
Forum Addict

Joined: February 25th, 2011, 3:16 am
Posts: 462
Location: Unknown
Thanks haxorico , but I don't know why ur code and my code didn't work. :(:(


Top
 Profile  
 
PostPosted: May 9th, 2013, 11:34 am 
Offline
Super Moderator
User avatar

Joined: February 24th, 2009, 1:31 pm
Posts: 3815
Location: JEW LAND
I explained why your code didn't work.
Your trigger has a player-event and you are using the "triggeringunit" command. That makes no sense.

_________________
Image
Spoiler:
(02:24:09)
Code:
ChatBot: FatherSpace logs into the Chat.
(02:24:28) Lanaya: Gtfo ken.
(02:24:33) ChatBot: FatherSpace logs out of the Chat.
(02:24:40) Lanaya: Thought so. bitch.
(02:24:44) ChatBot: FatherSpace logs into the Chat.
(02:24:48) FatherSpace: Can I come back yet?
(02:24:51) Lanaya: What'd i say earlier.
(02:24:51) Lanaya: No.
(02:24:58) FatherSpace: Let's try this...
(02:25:01) ChatBot: Lanaya has been logged out (Kicked).
Code:

(14:33:51) 2Pac: Do you know what'S so funny?
(14:34:01) Lanaya: No, please show me.
(14:34:07) 2Pac: This.
(14:34:09) ChatBot: Lanaya has been logged out (Kicked).
(14:34:10) 2Pac:


Code:
(14:35:59) haxorico: No one will belive me if I say "I got this song from 2pac on MSN" lolz ^^
(14:36:02) Lanaya: lolz.
(14:36:16) 2Pac: I AIN'T DEAD FFS.
(14:36:26) 2Pac: I'm a living legend, y'now.
(14:37:17) haxorico: why is 2Pac a legend?
(14:37:28) Lanaya: He's the worse rapper evar.

Code:
(15:42:51) Lanaya: can i suck , . . .

Code:
(13:55:21) ChatBot: 2Pac rolls 1d100 and gets 1.
(13:55:21) ChatBot: haxorico rolls 1d2 and gets 2.
(13:55:27) haxorico: owned?

Code:
GeorgeMots: xplain what happens in SP. Why cant you save?
dast.-:i need play with 2 players

Code:
(21:53:08) (673237): plzplzplz, im sorry about before.
(21:53:26) FatherSpace: I'm sorry you were born.
(21:53:31) ChatBot: (673237) has been logged out (Kicked).


Code:
(10:08:02) Bartimaeus: you do know run I youtube channel for my favorite music, right?


Top
 Profile  
 
PostPosted: June 5th, 2013, 6:59 pm 
Offline
Forum Addict

Joined: February 25th, 2011, 3:16 am
Posts: 462
Location: Unknown
Problem solved ! Thanks you Haxorico .


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 23 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group

phpBB SEO


Privacy Policy Statement
Impressum (German)