AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Creating a ladder. (https://forums.alliedmods.net/showthread.php?t=50350)

[ --<-@ ] Black Rose 01-24-2007 13:44

Creating a ladder.
 
Has anyone succeeded?
I've tryed lots of stuff but nothing seems to work.

Sure, the ent is created but i cant climb it...

This didn't work.
Code:
new ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "func_ladder")) if ( ent ) {     set_pev(ent, pev_origin, { 0.0, -400.0, -350.0 })     set_pev(ent, pev_solid, 2)     set_pev(ent, pev_mins, { 123.0, -3225.0, -61.0 })     set_pev(ent, pev_maxs, { 129.0, -2975.0, 181.0 })     engfunc(EngFunc_SetModel, ent, "*37") }

Could someone give me a hint or point me in the right direction?

organizedKaoS 01-24-2007 16:05

Re: Creating a ladder.
 
You cant make a ladder like that with amxx.

When making a map, a ladder consists of two brushes.

One is a func_illusionary and the other is a func_ladder, layered one on top of the other.

You would have to make two entities, func_illusionary then func_ladder and place the func_ladder over the func_illusionary.

The func_illusionary brush holds the texture and the func_ladder is drawn invisible on map compile, which uses the trigger texture.

[ --<-@ ] Black Rose 01-24-2007 16:23

Re: Creating a ladder.
 
ok... 2 bad :/

XxAvalanchexX 01-24-2007 18:16

Re: Creating a ladder.
 
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.

organizedKaoS 01-24-2007 23:48

Re: Creating a ladder.
 
Quote:

Originally Posted by XxAvalanchexX (Post 431195)
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.

I have always used two brushes to make ladders and maps that come standard with cs...assault, oilrig, militia for example, use the two brush method.

Even tutorials on how to make ladders describe the two brush method.

The visible brush nearby is how a player knows a ladder is there.

The two brush method for ladders exists for the reason that for func_ladder, the trigger texture is used. That texture is drawn invisible on map compile.

Without the func_illusionary with the ladder texture, you would not be able to see the ladder dimensions or the ladder itself.

commonbullet 01-25-2007 00:25

Re: Creating a ladder.
 
Quote:

Originally Posted by organizedKaoS (Post 431319)
Without the func_illusionary with the ladder texture, you would not be able to see the ladder dimensions or the ladder itself.

You could add a 'ladder functionality' to an existent map object, i.e.
And it doesn't require to be a func_illusionary or even a brush entity.

dutchmeat 01-25-2007 05:48

Re: Creating a ladder.
 
create a illusionary ladder! (:) )

[ --<-@ ] Black Rose 01-25-2007 12:09

Re: Creating a ladder.
 
Thank you all. I've tryed some different combinations and it didn't really work well... I can't climb it. It looks like I'm lagging my way trough it.
Code:
#define ORIGIN { 0.0, -400.0, -350.0 } #define ABSMAX {-958.0, 1474.0, -94.0} #define ABSMIN {-978.0, 1342.0, -3042.0}         ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "func_ladder"))     if ( ent ) {         set_pev(ent, pev_origin, ORIGIN)         set_pev(ent, pev_solid, SOLID_BSP)         set_pev(ent, pev_movetype, MOVETYPE_PUSH)         engfunc(EngFunc_SetModel, ent, "*12")         set_pev(ent, pev_modelindex, 13)         set_pev(ent, pev_absmin, ABSMIN)         set_pev(ent, pev_absmax, ABSMAX)     }

Cheap_Suit 01-26-2007 17:51

Re: Creating a ladder.
 
Quote:

Originally Posted by commonbullet (Post 431333)
You could add a 'ladder functionality' to an existent map object, i.e.
And it doesn't require to be a func_illusionary or even a brush entity.

Please do share. Also will it work using fake touch? Because your other thread (about detecting touching the ladder) says that you cant hook it to touch.

lunarwolfx 01-26-2007 21:10

Re: Creating a ladder.
 
Quote:

Originally Posted by [ --<-@ ] Black Rose (Post 431508)
Thank you all. I've tryed some different combinations and it didn't really work well... I can't climb it. It looks like I'm lagging my way trough it.
Code:
#define ORIGIN { 0.0, -400.0, -350.0 } #define ABSMAX {-958.0, 1474.0, -94.0} #define ABSMIN {-978.0, 1342.0, -3042.0}         ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "func_ladder"))     if ( ent ) {         set_pev(ent, pev_origin, ORIGIN)         set_pev(ent, pev_solid, SOLID_BSP)         set_pev(ent, pev_movetype, MOVETYPE_PUSH)         engfunc(EngFunc_SetModel, ent, "*12")         set_pev(ent, pev_modelindex, 13)         set_pev(ent, pev_absmin, ABSMIN)         set_pev(ent, pev_absmax, ABSMAX)     }

The problem might be because you need to take a brush that has the aaatrigger texture.


All times are GMT -4. The time now is 22:30.

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