(Keeps Hive Alive)
Go Back   The Hive Workshop - A Warcraft III Modding Site > Warcraft III Resources > Submissions

Submissions Submit JASS resources! If approved, they will be moved to their proper section.
Please read me first.

Reply
 
LinkBack Thread Tools Display Modes
Old 04-27-2008, 04:47 PM   #1 (permalink)

Anozer jasser
 
Join Date: Apr 2008
Posts: 237

Troll-Brain has little to show at this moment (13)Troll-Brain has little to show at this moment (13)


Pathing functions

1234

Last edited by Troll-Brain; 01-05-2009 at 08:04 PM..
Troll-Brain is offline   Reply With Quote
Old 05-01-2008, 01:36 AM   #2 (permalink)
 
PurgeandFire111's Avatar

User Title
 
Join Date: Nov 2006
Posts: 1,029

PurgeandFire111 is a jewel in the rough (155)


call BJDebugMsg("a negative radius o_0")
I lol'D at this. =D

But why not do initial-setting. I don't think there is much harm if you simply initially set the variable before the debugs. Afterall, they are all reals.

Else, nice job...
__________________
Vote For The Hive Workshop!
Funny but the TRUTH! :
Quote:
Originally Posted by Sopho
Unprotecting maps is not right its like crime and YOU GO MAKE YOUR OWN MAP AND BE HAPPY! Don't be gay n00b!

1. You can if it is yours but you should not if it is not. It is like stealing information and using it as if it is your own. It si gay stuff and people who unprotect maps are gay themselves.
PurgeandFire111 is offline   Reply With Quote
Old 05-01-2008, 10:42 AM   #3 (permalink)

Anozer jasser
 
Join Date: Apr 2008
Posts: 237

Troll-Brain has little to show at this moment (13)Troll-Brain has little to show at this moment (13)


Quote:
Originally Posted by PurgeandFire111 View Post
call BJDebugMsg("a negative radius o_0")
I lol'D at this. =D

But why not do initial-setting. I don't think there is much harm if you simply initially set the variable before the debugs. Afterall, they are all reals.

Else, nice job...
i don't really understood what you said but i guess if a debug is true, then it's an error of the user, so the function should be stopped.
just enable the debug mode for test your map and then disable the debug mode and save your map.
the debug line will be simply removed in the script of the map

Else, thx
Troll-Brain is offline   Reply With Quote
Old 05-01-2008, 05:25 PM   #4 (permalink)

User
 
Join Date: Mar 2005
Posts: 230

DiscipleOfLife is on a distinguished road (71)DiscipleOfLife is on a distinguished road (71)


I think he ment you to do this:
function SetCircleTerrainPathable takes real xc,real yc,real radius,pathingtype t,boolean b returns boolean
    local real xMin=xc-radius
    local real yMin=yc-radius
    local real xMax=xc+radius
    local real yMax=yc+radius
    local real x=xMin
    local real y=yMin
    local real dx
    local real dy

    debug if t==null then
    debug call BJDebugMsg("the pathingtype is null")
    debug return false
    debug elseif radius<0.0 then
    debug call BJDebugMsg("a negative radius o_0")
    debug return false
    debug endif

    //...
__________________
DiscipleOfLife is offline   Reply With Quote
Old 05-01-2008, 05:39 PM   #5 (permalink)

Anozer jasser
 
Join Date: Apr 2008
Posts: 237

Troll-Brain has little to show at this moment (13)Troll-Brain has little to show at this moment (13)


ok post edited, thx
Troll-Brain is offline   Reply With Quote
Old 05-03-2008, 04:44 PM   #6 (permalink)

Anozer jasser
 
Join Date: Apr 2008
Posts: 237

Troll-Brain has little to show at this moment (13)Troll-Brain has little to show at this moment (13)


approved or not and why ?
Troll-Brain is offline   Reply With Quote
Old 05-06-2008, 05:25 AM   #7 (permalink)
 
PurgeandFire111's Avatar

User Title
 
Join Date: Nov 2006
Posts: 1,029

PurgeandFire111 is a jewel in the rough (155)


EDIT: Nvm.

Btw, I think you have to wait a little longer... The mods come at different times. :P
__________________
Vote For The Hive Workshop!
Funny but the TRUTH! :
Quote:
Originally Posted by Sopho
Unprotecting maps is not right its like crime and YOU GO MAKE YOUR OWN MAP AND BE HAPPY! Don't be gay n00b!

1. You can if it is yours but you should not if it is not. It is like stealing information and using it as if it is your own. It si gay stuff and people who unprotect maps are gay themselves.
PurgeandFire111 is offline   Reply With Quote
Old 05-22-2008, 09:28 PM   #8 (permalink)

iRawr
 
Join Date: Dec 2005
Posts: 8,349

PurplePoot is a splendid one to behold (807)PurplePoot is a splendid one to behold (807)PurplePoot is a splendid one to behold (807)

Paired Mapping Contest #4 Winner: Fallen Angel - Lucifer's Keep Respected User: This user has been given the respected user award. Map Development Mini-Contest #1 Winner: Stand of the Elements 

The suggestion about locals applies to the SetPathingTypeRect too.

Also, the debugs should be removed, except the ones in front of the messages; it's a good idea to automatically return when there is no rect, etc.

Also, grid squares are 128x128, not 32x32.
PurplePoot is offline   Reply With Quote
Old 05-24-2008, 11:16 AM   #9 (permalink)

Anozer jasser
 
Join Date: Apr 2008
Posts: 237

Troll-Brain has little to show at this moment (13)Troll-Brain has little to show at this moment (13)


Quote:
The suggestion about locals applies to the SetPathingTypeRect too.
i don't see why exactly because if a rect is null i don't need to give a value to the variables.
and in general i avoid to work with a null handle

Quote:
Also, the debugs should be removed, except the ones in front of the messages; it's a good idea to automatically return when there is no rect, etc.
that's true, post edited
Quote:
Also, grid squares are 128x128, not 32x32.
False, or not with a function which take a cell, or x/y arguments, at least.
Troll-Brain is offline   Reply With Quote
Old 05-25-2008, 03:01 AM   #10 (permalink)
 
Earth-Fury's Avatar

Inside You <3
 
Join Date: Feb 2004
Posts: 545

Earth-Fury is a glorious beacon of light (532)Earth-Fury is a glorious beacon of light (532)Earth-Fury is a glorious beacon of light (532)Earth-Fury is a glorious beacon of light (532)Earth-Fury is a glorious beacon of light (532)

PayPal Donor: This user has donated to The Hive. 

The defaultly white squares in WE's grid are 128^2. (The size of a terrain square.) Not 32^2.
__________________
Giving reputation is a nice way to say thank you to someone that helps you!
Earth-Fury is offline   Reply With Quote
Old 05-25-2008, 10:58 AM   #11 (permalink)

Anozer jasser
 
Join Date: Apr 2008
Posts: 237

Troll-Brain has little to show at this moment (13)Troll-Brain has little to show at this moment (13)


test that :

//! textmacro Msg takes X,Y
call BJDebugMsg(R2S(xMin+$X$)+" , "+R2S(yMin+$X$) +" " +B2S(IsTerrainPathable(xMin+$X$,yMin+$Y$,PATHING_TYPE_FLYABILITY)))
//! endtextmacro



function B2S takes boolean b returns string
    if b then
        return "false"
    endif
 return "true"
endfunction

function Test takes real x, real y returns nothing
 local real xMin= 32.0*R2I(x/32.0)
 local real yMin= 32.0*R2I(y/32.0)

 //! runtextmacro Msg("-0.1","-0.1")
 //! runtextmacro Msg("0","0")
 //! runtextmacro Msg("31.9","31.9")
 //! runtextmacro Msg("32.0","32.0")
 call SetTerrainPathable(x,y,PATHING_TYPE_FLYABILITY,false)
 call BJDebugMsg(" ")
 //! runtextmacro Msg("-0.1","-0.1")
 //! runtextmacro Msg("0","0")
 //! runtextmacro Msg("31.9","31.9")
 //! runtextmacro Msg("32.0","32.0")


endfunction

scope Test initializer init

    private function Actions takes nothing returns nothing
        call Test(0.0,0.0) // or what you want
    endfunction

    private function init takes nothing returns nothing
     local trigger t=CreateTrigger()

        call TriggerRegisterPlayerEventEndCinematic(t,Player(0))
        call TriggerAddAction(t,function Actions)
    endfunction

endscope

Btw in the editor set the grid to his smaller size, zoom and you will see that the smallest is 32*32

I've renamed the function SetCircleTerrainPathable -> SetDiskTerrainPathable and added the real function SetCircleTerrainPathable.

The SetCircleTerrainPathable function can fail if you move unit with a trigger action (SetUnitPosition, SetUnitX,SetUnitY).
I mean the unit could pass the pathing, even if she is not allowed.
For solve this i will probably add a new function

Last edited by Troll-Brain; 05-25-2008 at 05:41 PM..
Troll-Brain is offline   Reply With Quote
Old 05-27-2008, 01:51 PM   #12 (permalink)

iRawr
 
Join Date: Dec 2005
Posts: 8,349

PurplePoot is a splendid one to behold (807)PurplePoot is a splendid one to behold (807)PurplePoot is a splendid one to behold (807)

Paired Mapping Contest #4 Winner: Fallen Angel - Lucifer's Keep Respected User: This user has been given the respected user award. Map Development Mini-Contest #1 Winner: Stand of the Elements 

The smallest grid squares are 32x32, yes, but that doesn't have to do with anything - the white grid squares (those used for terrain tiles), are 128x128.

So unless the SetTerrainPathable function behaves weirdly (which it might) relative to other functions that handle terrain, it should be 128x128. I'll give this a spin later tonight.
PurplePoot is offline   Reply With Quote
Old 05-27-2008, 05:19 PM   #13 (permalink)

Anozer jasser
 
Join Date: Apr 2008
Posts: 237

Troll-Brain has little to show at this moment (13)Troll-Brain has little to show at this moment (13)


Quote:
Originally Posted by PurplePoot View Post
The smallest grid squares are 32x32, yes, but that doesn't have to do with anything - the white grid squares (those used for terrain tiles), are 128x128.

So unless the SetTerrainPathable function behaves weirdly (which it might) relative to other functions that handle terrain, it should be 128x128. I'll give this a spin later tonight.
Ok, i got it what you want mean.
But the function SetTerrainPathable still use 32*32.
I dunno for the others.
It's more accurate and you don't really need to change the terrain type as well.
And i can't imagine use this with 128*128, it will be so bad, like draw a small picture with a big pen ...
Anyway the function SetTerrainType is so poorly accurate
Troll-Brain is offline   Reply With Quote
Old 05-30-2008, 12:19 AM   #14 (permalink)
 
PurgeandFire111's Avatar

User Title
 
Join Date: Nov 2006
Posts: 1,029

PurgeandFire111 is a jewel in the rough (155)


http://wc3jass.com/viewtopic.php?t=1994

Hm... I found that. Does it do the same thing that yours does? Is there a difference?
__________________
Vote For The Hive Workshop!
Funny but the TRUTH! :
Quote:
Originally Posted by Sopho
Unprotecting maps is not right its like crime and YOU GO MAKE YOUR OWN MAP AND BE HAPPY! Don't be gay n00b!

1. You can if it is yours but you should not if it is not. It is like stealing information and using it as if it is your own. It si gay stuff and people who unprotect maps are gay themselves.
PurgeandFire111 is offline   Reply With Quote
Old 05-30-2008, 11:44 AM   #15 (permalink)

Anozer jasser
 
Join Date: Apr 2008
Posts: 237

Troll-Brain has little to show at this moment (13)Troll-Brain has little to show at this moment (13)


i didn't know this function.
Anyway it's really different of mine.
Obviously you didn't read the code and his description
I apply the path for a rect, and a rect can be a multiple of 32.
I don't care about SetTerrainType
Troll-Brain is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[JASS] Two functions calling each other... Preskooldude Triggers & Scripts 8 02-07-2008 03:48 PM
[JASS] Functions... NoNZealot Triggers & Scripts 4 10-20-2007 09:38 PM
[JASS] My JASS Functions Ralle Triggers & Scripts 5 06-06-2007 05:53 PM
Camera Functions Pixelated World Editor Help Zone 0 12-05-2006 07:37 PM
[JASS] Replay functions TheUnholyTrinity Triggers & Scripts 1 09-20-2006 09:13 AM

All times are GMT. The time now is 08:54 AM.






Your link here 
Debt Help | Car Loan | Ultimate Credit Card Guide | Travel Canada | Credit Card Consolidation
Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
Copyright©Ralle