Raised This Month: $ Target: $400
 0% 

Creating a ladder.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 01-24-2007 , 18:16   Re: Creating a ladder.
Reply With Quote #4

A ladder consists of one brush: func_ladder. A ladder doesn't require a visible brush nearby to be usable. Furthermore, not all ladder-representation brushes are func_illusionary.

This is how I create a brush model in my hostage AI plugin:

Code:
new ent, wall, Float:absmin[3], Float:absmax[3]; new wall_classname = engfunc(EngFunc_AllocString,"func_wall"); while((ent = engfunc(EngFunc_FindEntityByString,ent,"classname","func_illusionary")) != 0) {     wall = engfunc(EngFunc_CreateNamedEntity,wall_classname);     // make me solid     set_pev(wall,pev_solid,SOLID_BSP);     set_pev(wall,pev_movetype,MOVETYPE_PUSH);     // make me the same size and position as func_illusionary     set_pev(wall,pev_modelindex,pev(ent,pev_modelindex));     pev(ent,pev_absmin,absmin);     pev(ent,pev_absmax,absmax);     engfunc(EngFunc_SetSize,wall,absmin,absmax); }

This creates a func_wall over all func_illusionary entities, of the same size. Don't ask why. Basically, the requirements are: solid type is SOLID_BSP, move type is MOVETYPE_PUSH (game crashes if there is a SOLID_BSP without MOVETYPE_PUSH), and model index is the same as another brush model index (I first tried setting the model string, like you do, but it didn't work). I can't remember if the SetSize was required for it to work or not.

Anyway, I don't know if you can create a ladder of a custom size, I think you probably have to leech off of existing brush models. Also, func_ladder might use a SOLID_TRIGGER instead of SOLID_BSP.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS

Last edited by XxAvalanchexX; 01-24-2007 at 18:21.
XxAvalanchexX is offline
 



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 22:30.


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