 |   |  |  |
Submissions Submit JASS resources! If approved, they will be moved to their proper section. Please read me first. |
 |
|
04-27-2008, 04:47 PM
|
#1 (permalink)
|
Anozer jasser
Join Date: Apr 2008
Posts: 237
|
Pathing functions
Last edited by Troll-Brain; 01-05-2009 at 08:04 PM..
|
|
|
05-01-2008, 01:36 AM
|
#2 (permalink)
|
User Title
Join Date: Nov 2006
Posts: 1,029
|
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.
|
|
|
|
05-01-2008, 10:42 AM
|
#3 (permalink)
|
Anozer jasser
Join Date: Apr 2008
Posts: 237
|
Quote:
Originally Posted by PurgeandFire111
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
|
|
|
05-01-2008, 05:25 PM
|
#4 (permalink)
|
User
Join Date: Mar 2005
Posts: 230
|
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 //...
|
|
|
05-01-2008, 05:39 PM
|
#5 (permalink)
|
Anozer jasser
Join Date: Apr 2008
Posts: 237
|
|
|
|
05-03-2008, 04:44 PM
|
#6 (permalink)
|
Anozer jasser
Join Date: Apr 2008
Posts: 237
|
approved or not and why ?
|
|
|
05-06-2008, 05:25 AM
|
#7 (permalink)
|
User Title
Join Date: Nov 2006
Posts: 1,029
|
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.
|
|
|
|
05-22-2008, 09:28 PM
|
#8 (permalink)
|
iRawr
Join Date: Dec 2005
Posts: 8,349
|
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.
|
|
|
05-24-2008, 11:16 AM
|
#9 (permalink)
|
Anozer jasser
Join Date: Apr 2008
Posts: 237
|
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.
|
|
|
05-25-2008, 03:01 AM
|
#10 (permalink)
|
Inside You <3
Join Date: Feb 2004
Posts: 545
|
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!
|
|
|
05-25-2008, 10:58 AM
|
#11 (permalink)
|
Anozer jasser
Join Date: Apr 2008
Posts: 237
|
test that :
//! textmacro Msg takes X,Y call BJDebugMsg (R2S (xMin+$X$ )+ " , "+R2S (yMin+$X$ ) + " " +B2S (IsTerrainPathable (xMin+$X$,yMin+$Y$,PATHING_TYPE_FLYABILITY )))//! endtextmacrofunction B2S takes boolean b returns string if b then return "false" endif return "true"endfunctionfunction 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")endfunctionscope 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 ) endfunctionendscope
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..
|
|
|
05-27-2008, 01:51 PM
|
#12 (permalink)
|
iRawr
Join Date: Dec 2005
Posts: 8,349
|
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.
|
|
|
05-27-2008, 05:19 PM
|
#13 (permalink)
|
Anozer jasser
Join Date: Apr 2008
Posts: 237
|
Quote:
Originally Posted by PurplePoot
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
|
|
|
05-30-2008, 12:19 AM
|
#14 (permalink)
|
User Title
Join Date: Nov 2006
Posts: 1,029
|
__________________
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.
|
|
|
|
05-30-2008, 11:44 AM
|
#15 (permalink)
|
Anozer jasser
Join Date: Apr 2008
Posts: 237
|
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
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|  |  |  |  |   |  |
|