Raised This Month: $32 Target: $400
 8% 

Box System


Post New Thread Reply   
 
Thread Tools Display Modes
Rirre
Veteran Member
Join Date: Nov 2006
Old 07-18-2012 , 15:22   Re: Box System
Reply With Quote #11

Got it to work now. Idk how, but it works.

Thank you, works great!
Rirre is offline
Astro
Member
Join Date: Jul 2011
Old 07-25-2012 , 16:40   Re: Box System
Reply With Quote #12

My linux server freezes when the plugin tries to save the .vdf file. Plugin successfully creates the file but doesn't write anything and freezes (no error in the amxx error file, no error in the hlds debug file). I figured out that the last call before freeze is vdf_save(tree); in storage.inl so I thought that there might be problem with the VDF module but I don't experience this kind of problems with other plugins that call this function...

Edit1 (Debugging my error): I have edited the plugin to save dummy results and they save without freezing the server so it is an plugin issue.
Edit2 (Debugging my error): Got it! The BOX_Save() function saves one empty record! See comments in the storage.inl's BOX_Save() functions' code.

PHP Code:
BOX_Save()
{
    new 
VdfTree:tree vdf_create_tree(gszConfigDirPerMap);
    new 
VdfNode:root;
    new 
VdfNode:box;
    new 
VdfNode:vector;
    
    new 
szValue[32];
    new 
Float:fOrigin[3];
    
    
root vdf_get_root_node(tree);
    
vdf_set_node_key(root "Box");
    
    
    for(new 
i=0igiZonesPi++)
    {
        new 
ent giZones[i];
        
        
/*
        pev(ent, PEV_TYPE, szValue, 31);

        So, what happend there? The first zone is always empty, so the origins and other
        floats would be OK but the pev_netname (PEV_TYPE) sets szValue to "".

        box = vdf_append_child_node(tree, root, szValue);
        
        And vdf_append_child_node fails to create node named "", szValue is not a value
        this time, so it is a problem.
        */

        
pev(entPEV_TYPEszValue31);
        
box vdf_append_child_node(treerootszValue[0] ? szValue "empty"); // My hotfix
        
        
vector vdf_append_child_node(treebox"origin");
        
pev(entpev_originfOrigin);
        
        
formatex(szValue31"%.1f"fOrigin[0]), vdf_append_child_node(treevector"X"szValue);
        
formatex(szValue31"%.1f"fOrigin[1]), vdf_append_child_node(treevector"Y"szValue);
        
formatex(szValue31"%.1f"fOrigin[2]), vdf_append_child_node(treevector"Z"szValue);
        
        
pev(entpev_minsfOrigin);
        
vector vdf_append_child_node(treebox"mins");
        
        
formatex(szValue31"%.1f"fOrigin[0]), vdf_append_child_node(treevector"X"szValue);
        
formatex(szValue31"%.1f"fOrigin[1]), vdf_append_child_node(treevector"Y"szValue);
        
formatex(szValue31"%.1f"fOrigin[2]), vdf_append_child_node(treevector"Z"szValue);
        
        
pev(entpev_maxsfOrigin);
        
vector vdf_append_child_node(treebox"maxs");
        
        
formatex(szValue31"%.1f"fOrigin[0]), vdf_append_child_node(treevector"X"szValue);
        
formatex(szValue31"%.1f"fOrigin[1]), vdf_append_child_node(treevector"Y"szValue);
        
formatex(szValue31"%.1f"fOrigin[2]), vdf_append_child_node(treevector"Z"szValue);
        
    }

    
vdf_save(tree);

Edit3 (Features): It would be awesome (well, more awesome) if it was possible to make the box visible – glow for example.

Last edited by Astro; 07-25-2012 at 19:02. Reason: Typo
Astro is offline
Scherzo
Senior Member
Join Date: Feb 2007
Location: Kwidzyn, Poland
Old 07-26-2012 , 02:31   Re: Box System
Reply With Quote #13

Well, good analysis Astro I will release official patch after little research this evening (my local time).

I agree it would be nice to see zones, i would extend API (which is quite basic now). My first idea of making it visible is add some colors to floor under box, like auras in rpgs http://diablo3.pl/wp-content/uploads...rb-warcry1.jpg
but its not the only possible solution, would nice to have flexible managment of appearance and i will try provide that.
Scherzo is offline
Astro
Member
Join Date: Jul 2011
Old 07-26-2012 , 11:14   Re: Box System
Reply With Quote #14

Also it would be awesome if it was possible to rotate the box. Currently I'm able to rotate it's model, but obviously I'm too dumb to rotate the anchors and lines.

Edit (Reply I forgot to write): I'm going to use this plugin for creating a track for my surf_ server... I used some stargate model for the box ent (anchors ents have the default models) and I used a set_rendering(ent, kRenderFxGlowShell, 0, 255, 0, kRenderTransAlpha, 50); effect and it looks good, so that might be an inspiration.

[IMG]http://img42.**************/img42/6105/2012072600002m.jpg[/IMG]

Also, I think that it would be useful if you could set (or at least see) id of a box when creating it. For example for my checkpoints I will definitely use class like "FirstTrack", but I would like to be able to use something like ID, so that first checkpoint of track one could be registered as an entity class "FirstTrack" ID "1".

Last edited by Astro; 07-26-2012 at 13:19.
Astro is offline
Scherzo
Senior Member
Join Date: Feb 2007
Location: Kwidzyn, Poland
Old 07-26-2012 , 15:34   Re: Box System
Reply With Quote #15

Id is greate idea! implemented, check this out Back compatibility is kept. Bug with empty class reproduced, verified and fixed. Thanks. I added implosion effect for visualization of working box, copying box's type to menu on select.

Appearance of box is task for weekend in fact, so keep in touch.


Edit.
Rotation is impossible to do with native entity (hl engine), i feel no competent to take care about space modeling manually, i'm sorry. My suggestion is to use as well as matched box for rotated object with little tolerance, should work good.

Last edited by Scherzo; 07-26-2012 at 15:40.
Scherzo is offline
Astro
Member
Join Date: Jul 2011
Old 07-28-2012 , 15:03   Re: Box System
Reply With Quote #16

I didn't know that (I've seen entmod, and thought that AMXX is capable of doing the same things, thanks for correcting me). Despite the fact that you can't rotate the entity I see a reason to enable rotating the box's model (if you enable setting one, of course).

Edit: Stupid idea.

Last edited by Astro; 07-29-2012 at 14:30.
Astro is offline
Scherzo
Senior Member
Join Date: Feb 2007
Location: Kwidzyn, Poland
Old 07-29-2012 , 13:07   Re: Box System
Reply With Quote #17

There is stock (BOX_GetId) in .inc file to retrieve box's ID from ent id in forwards to avoid pushing strings. All native function which you listed would be just wrappers for fakemeta/engine function, so unefficient. For such task i can provide stock functions in fact.

My goal wasnt create easy interface for begginer developers, i focused on friendly interface for end user (admin). In my opinion if you can do something with box, you should know how to find them

Also this plugin will not provide models related stuff since i already made plugin for this before. If you need that i would release it here also, but i dont want combine them into one. My plan was to add scallable sprites helper.
Scherzo is offline
OvidiuS
Chillaxin'
Join Date: Dec 2009
Location: Serbia
Old 10-02-2012 , 17:59   Re: Box System
Reply With Quote #18

Quote:
Originally Posted by Astro View Post
Also it would be awesome if it was possible to rotate the box. Currently I'm able to rotate it's model, but obviously I'm too dumb to rotate the anchors and lines.

Edit (Reply I forgot to write): I'm going to use this plugin for creating a track for my surf_ server... I used some stargate model for the box ent (anchors ents have the default models) and I used a set_rendering(ent, kRenderFxGlowShell, 0, 255, 0, kRenderTransAlpha, 50); effect and it looks good, so that might be an inspiration.

[IMG]http://img42.**************/img42/6105/2012072600002m.jpg[/IMG]

Also, I think that it would be useful if you could set (or at least see) id of a box when creating it. For example for my checkpoints I will definitely use class like "FirstTrack", but I would like to be able to use something like ID, so that first checkpoint of track one could be registered as an entity class "FirstTrack" ID "1".
Can you post the model which you used?
I'm very interested in this.
OvidiuS is offline
Send a message via Skype™ to OvidiuS
Astro
Member
Join Date: Jul 2011
Old 10-10-2012 , 14:50   Re: Box System
Reply With Quote #19

Here you go…
Attached Files
File Type: 7z models.7z (242.2 KB, 363 views)
Astro is offline
OvidiuS
Chillaxin'
Join Date: Dec 2009
Location: Serbia
Old 10-12-2012 , 06:16   Re: Box System
Reply With Quote #20

Quote:
Originally Posted by Astro View Post
Here you go…
Thank you
OvidiuS is offline
Send a message via Skype™ to OvidiuS
Reply


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

Forum Jump


All times are GMT -4. The time now is 15:42.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode