Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: can someone explain the local.static setsize when spawning an object?

  1. #1

    Default can someone explain the local.static setsize when spawning an object?

    Hi lets say i want to spawn this cardtable

    local.static = spawn script_model
    local.static model "furniture/cardtable.tik"
    local.static.origin = ( -954.83 -1193.22 272.13 )
    local.static.angles = ( 0 0 0 )
    local.static solid
    local.static setsize "0 0 0" "0 0 0"

    if i just spawn it the brush is much bigger than the obj himself so i want to decrease the size of it.. and i tried but i get alot of weird things... like the half of the table is solid and other half isnt.
    or next to the table walking half into a brush and looks like lag

  2. #2

    Default

    heres what I did on a Nazi flag and it worked

    local.static.scale= 2.0 // make it what you want 1.0 .50 .03 etc.

  3. #3

    Default

    thats the scale siz of an object.... i just want to spawn a table on normal size... but when i just spawn it the brush is way bigger than the table itself... and when i make table bigger its bigger than a human..

  4. #4
    Purple Developer Purple Elephant1au's Avatar
    Join Date
    Feb 2012
    Location
    Australia
    Posts
    1,269

    Default

    Ok here goes

    Setsize refers to the bounding boxes of entities. The size in which they take mass or are solid.
    A model can be scaled up heaps so it looks HUGE , but its bounding box ( or setsize) will stay the same. So you could be walking through the brush texture even if the entity is solid. Or vise-versa you could scale a model down but not walk close to it because the bounding boxes are still in place.

    To view their bounding boxes , start a server from your mohaa.exe , with cheats enabled and the following settings
    sv_showbboxes 8
    There are many other settings for sv_showbboxes, but i used 8
    so your commandline might look something like this
    +set ui_console 1 +set cheats 1 +set thereisnomonkey 1 +set cl_playintro 0 + g_gametype 1 + set developer 1 +map dm/saturday_night_fever_3 +set sv_showbboxes 8

    Some models come with some outrageous bounding boxes, take your example above with the cardtable
    This is what the default bounding boxes look like
    Click image for larger version. 

Name:	table_original_bounding.png 
Views:	69 
Size:	658.0 KB 
ID:	983

    See how the bounding box extends way out past the origin and the tables brush texture.

    How we fix this is by changing the entity's setsize

    The setsize command is in two sections , both refer to either side of the 'origin' of the entity you are spawning. If you take a look at the above picture, the small blueish box in the center of the table down low is the 'origin'.

    local.static setsize ( 0 0 0 ) ( 0 0 0 )
    So each one represents each side of the origin , in xyz format , in general the first vectors is where you go negative from the origin ,
    ie ( -10 -10 -10 )
    The second set of vectors you would go positive
    ie ( 10 10 10 )
    This would make a square around the origin or 20x20 , ie 10 one way + 10 the other way = 20.

    I have already done the table for you to see how it would look once your done.
    local.static setsize ( -3 -42.5 0 ) ( 50 37.5 50 )
    Looks like
    Click image for larger version. 

Name:	table_change_bounding.png 
Views:	61 
Size:	242.0 KB 
ID:	982
    You picked a good example on a model that its origin isnt in the dead center of the brush texture. From this perspective , its right at the back and a little to the right of dead center.
    So the X values are -3 and 50
    from this angle it means the box goes forward 3 squares and back towards us for 50
    Y values are -42.5 and 37.5
    from this angle it means the box goes left 42.5 and right for 37.5
    Z values are 0 and 50 , meaning origin is on the floor , no need to go lower, and the tables height is around 50

    Things to Note is this WILL have to BE changed if you rotate or change the models angles, so you get it where you want first THEN adjust its setsize.
    Each model is different, some might have near perfect bounding boxes while others like the one above are completely out of it.

    Here are the other settings for sv_showbboxes
    Code:
    sv_showbboxes [0,28] -  show bounding boxes of entities.
            1 - shows all solid entities with their standard mins and maxs
            2 - shows all solid entities with their absmins and absmaxs
            3 - shows all entities that are solid and non solid but are not tagged as RF_DONTDRAW
            4 - shows all entities, even those tagged as RF_DONTDRAW
            7 - shows all entities with their TIKI bounding boxes
            8 – shows normal bounding boxes as well as a small bounding box around the origin
            9 – 28 – show bounding boxes of hit locations on models
    Last edited by Purple Elephant1au; December 1st, 2013 at 04:06 PM.

    Purple's Playground
    OBJ :
    103.29.85.127:12203
    xfire: purpleelephant1au
    email: purpleelephant1au@gmail.com
    skydrive: PurpleElephantSkydrive




  5. #5
    Senior Member beroo's Avatar
    Join Date
    Dec 2017
    Location
    Cairo
    Posts
    108

    Angry

    Quote Originally Posted by Purple Elephant1au View Post
    Ok here goes

    Setsize refers to the bounding boxes of entities. The size in which they take mass or are solid.
    A model can be scaled up heaps so it looks HUGE , but its bounding box ( or setsize) will stay the same. So you could be walking through the brush texture even if the entity is solid. Or vise-versa you could scale a model down but not walk close to it because the bounding boxes are still in place.

    To view their bounding boxes , start a server from your mohaa.exe , with cheats enabled and the following settings
    sv_showbboxes 8
    There are many other settings for sv_showbboxes, but i used 8
    so your commandline might look something like this
    +set ui_console 1 +set cheats 1 +set thereisnomonkey 1 +set cl_playintro 0 + g_gametype 1 + set developer 1 +map dm/saturday_night_fever_3 +set sv_showbboxes 8

    Some models come with some outrageous bounding boxes, take your example above with the cardtable
    This is what the default bounding boxes look like
    Click image for larger version. 

Name:	table_original_bounding.png 
Views:	69 
Size:	658.0 KB 
ID:	983

    See how the bounding box extends way out past the origin and the tables brush texture.

    How we fix this is by changing the entity's setsize

    The setsize command is in two sections , both refer to either side of the 'origin' of the entity you are spawning. If you take a look at the above picture, the small blueish box in the center of the table down low is the 'origin'.

    local.static setsize ( 0 0 0 ) ( 0 0 0 )
    So each one represents each side of the origin , in xyz format , in general the first vectors is where you go negative from the origin ,
    ie ( -10 -10 -10 )
    The second set of vectors you would go positive
    ie ( 10 10 10 )
    This would make a square around the origin or 20x20 , ie 10 one way + 10 the other way = 20.

    I have already done the table for you to see how it would look once your done.
    local.static setsize ( -3 -42.5 0 ) ( 50 37.5 50 )
    Looks like
    Click image for larger version. 

Name:	table_change_bounding.png 
Views:	61 
Size:	242.0 KB 
ID:	982
    You picked a good example on a model that its origin isnt in the dead center of the brush texture. From this perspective , its right at the back and a little to the right of dead center.
    So the X values are -3 and 50
    from this angle it means the box goes forward 3 squares and back towards us for 50
    Y values are -42.5 and 37.5
    from this angle it means the box goes left 42.5 and right for 37.5
    Z values are 0 and 50 , meaning origin is on the floor , no need to go lower, and the tables height is around 50

    Things to Note is this WILL have to BE changed if you rotate or change the models angles, so you get it where you want first THEN adjust its setsize.
    Each model is different, some might have near perfect bounding boxes while others like the one above are completely out of it.

    Here are the other settings for sv_showbboxes
    Code:
    sv_showbboxes [0,28] -  show bounding boxes of entities.
            1 - shows all solid entities with their standard mins and maxs
            2 - shows all solid entities with their absmins and absmaxs
            3 - shows all entities that are solid and non solid but are not tagged as RF_DONTDRAW
            4 - shows all entities, even those tagged as RF_DONTDRAW
            7 - shows all entities with their TIKI bounding boxes
            8 – shows normal bounding boxes as well as a small bounding box around the origin
            9 – 28 – show bounding boxes of hit locations on models
    I was trying to enable sv_showbboxes 8
    i started as P.E said to create new server with cheats enable and my commandline is
     +set ui_console 1 +set cheats 1 +set thereisnomonkey 1 +set cl_playintro 0 +set developer 3 +g_gametype 4 +map obj/obj_team2 

    my cheats was enable and i tried to set sv_showbboxes 8 but it didn't work as u see on this screenshot
    Click image for larger version. 

Name:	2123.jpg 
Views:	17 
Size:	56.2 KB 
ID:	2019

    the question is :
    1- firstly i faced strange problem when i added reborn patch in this test server if i used any cheats command the server gonna crash then i removed it and it didn't crash anymore ! , is reborn patch affecting on protected commands ? and mohaa.exe also ?

    note : i added +set sv_showbboxes 8 in target of shortcut but there was no changes.
    also i tried to use config server.cfg and put the command there laso the same, and i removed config and it was the same
    + i tried to do it in my linux host but the server crash looks like the first problem when i used reborn patch i'm using mohaa_clean_linux_latest_reborn.tar.gz .

    am i missed something ?
    Last edited by beroo; November 17th, 2018 at 05:03 PM.
    Greetings :-{[T_P]}- BeroO -{[CF]}-
    the-pharaohs.enjin.com

  6. #6

    Default

    sv_showbboxes works in singleplayer only. if you use it in a server, it will crash.
    so, test it in singleplayer first and when you get the setsize you want port the code to the server

  7. #7

    Default

    Theres one thing strange i have see between a windows server and linux is the triggers they are not in the same place we put or they have a different size when they spawn on him.

    I cant check if is realy that because i dont have linux to run on the local computer.


    Quote Originally Posted by Zappa View Post
    sv_showbboxes works in singleplayer only. if you use it in a server, it will crash.
    so, test it in singleplayer first and when you get the setsize you want port the code to the server
    No, works too on mp but has to be on your local game or will crash like you say
    Last edited by DoubleKill; November 19th, 2018 at 04:55 AM.

  8. #8

    Default

    Did you end up finding out the location of the trigger by checking it when made solid?

  9. #9
    Senior Member beroo's Avatar
    Join Date
    Dec 2017
    Location
    Cairo
    Posts
    108

    Default

    Quote Originally Posted by 1337Smithy View Post
    Did you end up finding out the location of the trigger by checking it when made solid?
    i enabled sv_showbboxes
    and this is the screenshot which worked with me in windows the first one
    Click image for larger version. 

Name:	table_original_bounding.jpg 
Views:	21 
Size:	52.5 KB 
ID:	2020



    Code:
        local.orb = spawn script_model
        local.orb model "static/corona_orange.tik"// other orb models  (fx/corona_red.tik ) (static/corona_orange.tik) 
        local.orb.origin = ( 2300 1810 -775 ) //marker,start point,always same as below cords
        local.orb notsolid
        local.orb svflags "+broadcast" //avoid lag by preventing status updates of this object
    
        local.trig = spawn trigger_multiple
        local.trig.origin = ( 2300 1810 -775 ) 
        local.trig setsize  ( -35 -35 -10 ) ( 35 35 10 )
        local.trig setthread jump1
        local.trig delay 0
        local.trig waitTill trigger
    end
    
    jump1:
        
        local.player = parm.other
    
        if(local.player !=NULL || local.player !=NIL) 
        {
         local.player jumpxy 460 215 215 // How high to jump
        }
    
    end

    but as u know the problem in Linux not on windows i cauldn't do anything while i have windows
    i tried serveral things to fix this but i don't know where is the problem i think it is out of trigger
    i want to enable sv_showbboxes in linux but this function works only in local server as u said

    i changed the size, origin, solid, notsolid and model for test
    i think the problem with this command (jumpxy) cuz (jump) works well with me but it didn't worked as like jumpxy u will jump for vertical but jumpxy u will have flexibility on the air

    the problem is for who didn't know what we are talking about
    this model have function to make u jump when u walk over it , it is working very well in windows but the problem in the linux only what is happening in the linux ?
    it will not make u jump when u are walking over it, but it will make u jump with 2 ways
    1- when u jump over the model it will make u jump.
    2- when u falling from above it will make u jump like a trampoline but when u fall away form it u should repeat what u did before as i said
    Last edited by beroo; November 20th, 2018 at 03:26 PM.
    Greetings :-{[T_P]}- BeroO -{[CF]}-
    the-pharaohs.enjin.com

  10. #10
    Senior Member beroo's Avatar
    Join Date
    Dec 2017
    Location
    Cairo
    Posts
    108

    Default

    i don't know if u are understood me or not but i will record it when i get my new router cuz i changed my isp
    Last edited by beroo; November 20th, 2018 at 11:39 PM.
    Greetings :-{[T_P]}- BeroO -{[CF]}-
    the-pharaohs.enjin.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •