Trigger
Events
Event Conditions
Conditions Actions
Custom script: set bj_wantDestroyGroup = true Unit Group - Pick every unit in (Playable Map Area) and do (Unit - Hide (Picked unit))
native GetBuilding takes player p returns unit
I dont really understand what these custom scripts do, they dont seem to change anything that I can see in-gamewhich most suits your style preferences
To test if they work, make the conditional statement print some game message if it passes. If no message appears in game then they do not work.I dont really understand what these custom scripts do, they dont seem to change anything that I can see in-game
Keep in mind that you have to destroy unit groups to prevent leaks: Things That Leak
- Count Units
- Events
- Conditions
- Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Number of units in (Units owned by Player 1 (Red) matching (((Matching unit) is A structure) Equal to True))) Equal to 0
- (Number of units in (Units owned by Player 2 (Blue) matching (((Matching unit) is A structure) Equal to True))) Equal to 0
- Then - Actions
- Unit - Remove Invulnerable (Neutral) from Resurrection Stone (Team 1) 0273 <gen>
- Else - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Number of units in (Units owned by Player 4 (Purple) matching (((Matching unit) is A structure) Equal to True))) Equal to 0
- (Number of units in (Units owned by Player 5 (Yellow) matching (((Matching unit) is A structure) Equal to True))) Equal to 0
- Then - Actions
- Unit - Remove Invulnerable (Neutral) from Resurrection Stone (Team 2) 0274 <gen>
- Else - Actions
At this point^ everything is working fineFrom things that leak:
is the leak solver for unit groups and you have to write it before you even create the group.
- Custom script: set bj_wantDestroyGroup = true
Unit Group - Pick every unit in (Playable Map Area) and do (Unit - Hide (Picked unit))
Yes, you can just use the trigger ZiBitheWand3r3r posted. In between the two custom scripts you can do your actions, as he said.So if I am going to switch it over to ZiBitheWand3r3r suggestion, should I erase the trigger with bj_wantDestroyGroup??
Player(x)=Player x+1, so yes Player(0) = Player 1Also do I replace (Number of units in (Units owned by Player 1 (Red) matching (((Matching unit) is A structure) Equal to True))) Equal to 0
with Custom script: if GetBuilding(Player(0))==null or do I keep both?? and is 0 = player 1? so 1 = player2?
Ok i double checked everything and now it says:you forgot the closing bracket ")" and the keyword "then"
It has to be "if ( GetBuilding(Player(0))==null ) then"
Look at my trigger above and make sure that your custom scripts are looking like mine.
Alos make sure that "native GetBuilding takes player p returns unit" is in the map header.
Native declaration Freedom
This feature (added in 0.9.I.0) is similar to global declarations, but it is for more advanced users, so if you do not understand a single thing of these few paragraphs, feel free to skip to the explanation about the debug keyword. Warcraft III supports declaration of natives in the map script, but it requires the natives to be declared just after the script's globals section. Jasshelper will detect these declarations along the map and move them to the correct place.
Why would you want to do this? And what native functions exactly? There are some few native functions that were created for AI scripts that are not declared in common.j, some of them are actually useful for Jass maps. There is also the possibility you are using a modded/hacked version of warcraft III, and importing a whole new common.j for the native functions is probably too annoying for you, in this case you can declare the new custom functions in the map as well.
There is a protection in this feature that will make jasshelper delete declarations of duplicate natives. (i.e if the native was already declared in common.j, it will remove the native from the map script, to ensure your map is actually playable). This heavily depends on the common.j version provided to jasshelper. This is something to consider if for some reason the common.j version you (or newgen pack) is passing to jasshelper is different to the common.j version you intend the map to be playable with.
Haha Zibi already has a big thank you in the description of my mapBig Thank you to Zibi and Jampion