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 > General Development
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 07-18-2015, 08:14 PM   #46
iNfraNe
PhD
 
iNfraNe's Avatar


Cinematics Moderator
 
Join Date: Dec 2003
Posts: 2,283

Submissions (7)

iNfraNe is just really nice (266)iNfraNe is just really nice (266)iNfraNe is just really nice (266)iNfraNe is just really nice (266)iNfraNe is just really nice (266)

Approved Map: Mortar Ball

Send a message via MSN to iNfraNe
Default

haha, well if that doesn't explain the world I don't know what will!
__________________
Ever so slightly active.
Table:
Past Projects:
The Spirit of Vengeance (Cinematic, Blizzard contest winner)
Elimination Tournament
Mortar Ball
iNfraNe is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 07-18-2015, 09:10 PM   #47
andreasaspenberg
User
 
Join Date: Jul 2007
Posts: 149

andreasaspenberg is on a distinguished road (12)

Default

i have noticed one issue and that is that the unit is randomly given a stop order. please help me fix that.
andreasaspenberg is offline   Reply With Quote
Old 07-18-2015, 10:03 PM   #48
Fledermaus
default string
 
Fledermaus's Avatar
 
Join Date: May 2006
Posts: 705

Submissions (1)

Fledermaus is a jewel in the rough (194)Fledermaus is a jewel in the rough (194)Fledermaus is a jewel in the rough (194)

Send a message via MSN to Fledermaus
Default

No, I'm not trying to hurt you at all. Clearly you missed the point of my post, don't really know why I expected anything different...

Quote:
Originally Posted by andreasaspenberg
i have noticed one issue and that is that the unit is randomly given a stop order. please help me fix that.
Maybe try posting your code. Kind of hard to tell what's wrong with no idea of what/how you are doing.

This is one of the problems with you, you ask everyone to help you without providing any useful information about your problem. And then if someone does something similar to you (e.g. tells you a way you could fix a problem, maybe it's not a complete solution but it has the gist of what you need) you get upset at them for "not providing a solution".
It makes you come off sounding arrogant and stupid and makes people (me at least) not want to help you because you are not helpful yourself.

Last edited by Fledermaus : 07-19-2015 at 06:02 AM.
Fledermaus is offline   Reply With Quote
Old 07-19-2015, 11:54 AM   #49
andreasaspenberg
User
 
Join Date: Jul 2007
Posts: 149

andreasaspenberg is on a distinguished road (12)

Default

i try my best to provide information. Untitled Trigger 001 Copy
Events
Time - Every 2.00 seconds of game time
Conditions
Actions
Unit Group - Pick every unit in (Units in (Playable map area) matching ((Current order of (Picked unit)) Equal to (Order(0)))) and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
And - All (Conditions) are true
Conditions
(Unit-type of (Picked unit)) Equal to Basal Golem created from blood forge
(Current order of (Picked unit)) Equal to (Order(NONE))
(Current order of (Picked unit)) Not equal to (Order(move))
(Current order of (Picked unit)) Not equal to (Order(metamorphosis))
Then - Actions
Unit - Order (Picked unit) to Night Elf Demon Hunter - Metamorphosis
Else - Actions
Do nothing
Wait until ((Current order of (Picked unit)) Equal to (Order(NONE))), checking every 1.00 seconds
Unit - Order (Picked unit) to Night Elf Druid Of The Claw - Night Elf Form
andreasaspenberg is offline   Reply With Quote
Old 07-20-2015, 07:55 AM   #50
Fledermaus
default string
 
Fledermaus's Avatar
 
Join Date: May 2006
Posts: 705

Submissions (1)

Fledermaus is a jewel in the rough (194)Fledermaus is a jewel in the rough (194)Fledermaus is a jewel in the rough (194)

Send a message via MSN to Fledermaus
Default

There's a [trigger] tag you can use to make your code as sexy as the editor:
Trigger:
Untitled Trigger 001 Copy
Collapse Events
Time - Every 2.00 seconds of game time
Conditions
Collapse Actions
Collapse Unit Group - Pick every unit in (Units in (Playable map area) matching ((Current order of (Picked unit)) Equal to (Order(0)))) and do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Collapse And - All (Conditions) are true
Collapse Conditions
(Unit-type of (Picked unit)) Equal to Basal Golem created from blood forge
(Current order of (Picked unit)) Equal to (Order(NONE))
(Current order of (Picked unit)) Not equal to (Order(move))
(Current order of (Picked unit)) Not equal to (Order(metamorphosis))
Collapse Then - Actions
Unit - Order (Picked unit) to Night Elf Demon Hunter - Metamorphosis
Collapse Else - Actions
Do nothing
Wait until ((Current order of (Picked unit)) Equal to (Order(NONE))), checking every 1.00 seconds
Unit - Order (Picked unit) to Night Elf Druid Of The Claw - Night Elf Form

I don't actually think that trigger should work at all. In your "Pick every unit in XXX matching", you are using Picked Unit (which should be used in the Loop). You need to change this to Matching Unit.
You could also make the matching condition an AND that checks if the unit is of the correct type AND that it's current order is 0. If you do this here the if/then/else in the Loop is not needed (also saves some processing time which is always good).
So if you chang the matching condition, you can get rid of the if/then/else which will make it look a lot simpler (the current order comparisons in your if are actually doing nothing - you are only selecting units who's current order is 0, so there is no point check it's current order is "NONE" (which will convert into 0 anyway), not "move" and not "metamorphosis"). You also really shouldn't be doing anything for the else action - if the units current order is 0, the only way the else is possibly reached is if it's unit ID is NOT "basal Golem created from blood forge" and in this case, you don't care about it.
Is "metamorphosis" the correct order? I thought you were using Bear Form?
I also think 2 seconds is way too big of an interval, I personally would use something like 0.05 at the very least.
Finally, since you're using a "Pick every unit and do" action, you should make sure to get rid of the Unit Group memory leak (even more so because it's a periodic trigger).

Here is what I came up with:
Trigger:
Working
Collapse Events
Time - Every 0.05 seconds of game time
Conditions
Collapse Actions
Custom script: set bj_wantDestroyGroup = true
Collapse Unit Group - Pick every unit in (Units in (Playable map area) matching (((Unit-type of (Matching unit)) Equal to YOUR_UNIT_TYPE_OF_THE_MOVING_UNIT) and ((Current order of (Matching unit)) Equal to (Order(0))))) and do (Actions)
Collapse Loop - Actions
Unit - Order (Picked unit) to Night Elf Druid Of The Claw - Bear Form

EDIT: Actually, that still leaks quite badly from "Units in XXX". I'll do a quick conversion to JASS because you can't get rid of that leak in GUI.
Place this in a trigger called "MorphUnitWhenItStopsMoving" and create a Unit Group variable called TempGroup (if you already have a TempGroup create another one with whatever name you want and replace the TempGroup in the code with it's name, ensuring to keep the udg_ at the start).
Collapse JASS:
function Trig_MorphUnitWhenItStopsMoving_Loop takes nothing returns boolean
    local unit u = GetFilterUnit()
    
    if GetUnitTypeId(u) == 'h000' and GetUnitCurrentOrder(u) == 0 then
        call IssueImmediateOrder(u, "bearform")
    endif
    
    set u = null
    return false
endfunction

function Trig_MorphUnitWhenItStopsMoving_Actions takes nothing returns nothing
    call GroupEnumUnitsInRect(udg_TempGroup, bj_mapInitialPlayableArea, Condition(function Trig_MorphUnitWhenItStopsMoving_Loop))
endfunction

//===========================================================================
function InitTrig_MorphUnitWhenItStopsMoving takes nothing returns nothing
    call TimerStart(CreateTimer(), 0.05, true, function Trig_MorphUnitWhenItStopsMoving_Actions)
endfunction
Replace the 'h000' with the unit id of your moving unit. If you are indeed using Metamorphosis instead of Bear Form, replace the "bearform" with "metamorphosis".

DISCLAIMER: This 100% pure JASS was written in a third party editor. It is not using any third party script but was written in the non-official editor :)

Last edited by Fledermaus : 07-20-2015 at 08:24 AM.
Fledermaus is offline   Reply With Quote
Old 07-20-2015, 11:27 PM   #51
andreasaspenberg
User
 
Join Date: Jul 2007
Posts: 149

andreasaspenberg is on a distinguished road (12)

Default

that is vjass. in regular jass it is takes nothing returns nothing. why is the community so determined to use third party software? using matching unit instead of picked unit rendered the trigger inoperable.
andreasaspenberg is offline   Reply With Quote
Old 07-21-2015, 12:09 AM   #52
Fledermaus
default string
 
Fledermaus's Avatar
 
Join Date: May 2006
Posts: 705

Submissions (1)

Fledermaus is a jewel in the rough (194)Fledermaus is a jewel in the rough (194)Fledermaus is a jewel in the rough (194)

Send a message via MSN to Fledermaus
Default

No, it's not. Condition functions (like the "Units in xxx matching condition") will create a function that takes nothing returns boolean. Try converting the GUI trigger I posted (or even yours) into jass and take a look for yourself.

You have said you don't know jass (or vjass), so please don't make accusations about jass when you don't know what you're talking about. It just makes you look stupid.
If you couldn't pass or return arguments to/from functions why would "takes X returns Y" be part of the syntax?
Take a look at the Blizzard.j (the code GUI is converted into) and see how many functions don't have "takes nothing returns nothing".
Please show me where in the vjass manual it says "holy shit guys, we added return types to functions, no longer do you have to set a variable at the end of a function then read it in the calling function. We're now a proper language!".

Matching unit should only be used in the "Matching condition" part, not in the loop part - that should still be Picked unit. If you'd read what I said or even looked at my GUI code, you would have realised that.

Last edited by Fledermaus : 07-21-2015 at 12:30 AM.
Fledermaus 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 04:07 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