Raised This Month: $7 Target: $400
 1% 

Create wall


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Basic-Master
Veteran Member
Join Date: Apr 2005
Location: hello pm
Old 11-04-2005 , 16:10   Create wall
Reply With Quote #1

Hello,
how can you create custom walls (if possible without custom models)? I've already searched on the forums but didn't find anything about it (except 2 buggy plugins).
Thanks in advance
Basic-Master is offline
Send a message via ICQ to Basic-Master Send a message via MSN to Basic-Master
Batman/Gorlag
Senior Member
Join Date: Aug 2005
Old 11-04-2005 , 17:34  
Reply With Quote #2

Code:
new wall = create_entity("func_wall") //I suppose you can use a random number generator to get x, y,  and z to set sizes for the wall, then decide what model to use if a wall is of a particular size.... new Float:x, Float:y, Float:z new chooser = random_num(a, b) new someModel[] switch(chooser){    case a: x = x'   //Where x', y', and z' can be any arbitrary numbers               y = y'                z = z'                someModel = "whatever" /* You can add more to the list of what x, y, and z could be here and decide what model the wall should be. . . . . .     case b: blah     default: blah */ new Float:min[3] = {-x, -y, -z} new Float:max[3] = {x, y, z} entity_set_size(wall, min, max) //If you want the wall right in front of you new Float:someOrigin[3] entity_get_vector(id, EV_VEC_origin, someOrigin) //You can offset the origin here. new offset = 200  //Can be any number new Float:adjustPos[3] velocity_by_aim(id, offset, adjustPos)  //To offset the origin to place wall in front of you //This prevents the wall from spawning in the current position of the user and make it spawn farther away from the user. someOrigin[0] += adjustPos[0]  someOrigin[1] += adjustPos[1] someOrigin[2] += adjustPos[2] entity_set_origin(wall, someOrigin) entity_set_model(wall, someModel)

I hope that answers your question of making a custom wall. You can use any models in the .gcf files so that the user doesn't have to load up any models.

Or there's always hammer to make walls if you're making a map .
__________________
GRR If only the amxmod programming were in Java.....
Java and C used to be two different languages, now Java is turning into another C. My logevent plugin
Batman/Gorlag is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 11-04-2005 , 19:45   Re: Create wall
Reply With Quote #3

Quote:
Originally Posted by Basic-Master
how can you create custom walls (if possible without custom models)?
The only way you can do it is to make an entity, make it solid, and give it a model to display over it. You can't create a real "wall" with amxx.
XxAvalanchexX is offline
Basic-Master
Veteran Member
Join Date: Apr 2005
Location: hello pm
Old 11-05-2005 , 05:28  
Reply With Quote #4

okay, thanks
but unfortunately I can't turn the wall with EV_VEC_angles (well the model turns but not the "basic" object you can collide with). here is my current function:
Code:
public cmdWall(id) {     new wall = create_entity("func_wall")     entity_set_model(wall, "models/wall.mdl") // I found it somewhere in the forums     // Set size and absmin+absmax values     new Float:mins[3]     mins = Float:{-100.0, -10.0, -75.0}     new Float:maxs[3]     maxs = Float:{100.0, -10.0, 75.0}     entity_set_vector(wall, EV_VEC_mins, mins)     entity_set_vector(wall, EV_VEC_maxs, maxs)     entity_set_vector(wall, EV_VEC_absmin, mins)     entity_set_vector(wall, EV_VEC_absmax, maxs)     // Turn model     new Float:vRetVector[3]     entity_get_vector(id, EV_VEC_v_angle, vRetVector)     vRetVector[0] = 0.0     entity_set_vector(wall, EV_VEC_angles, vRetVector)     // Get user origin     new Float:someOrigin[3]     entity_get_vector(id, EV_VEC_origin, someOrigin)     // You can offset the origin here.     new offset = 200     new Float:adjustPos[3]     velocity_by_aim(id, offset, adjustPos)     // This prevents the wall from spawning in the current position of the user and make it spawn farther away from the user.     someOrigin[0] += adjustPos[0]      someOrigin[1] += adjustPos[1]     someOrigin[2] += adjustPos[2]     entity_set_origin(wall, someOrigin)     // Set other values     entity_set_int(wall, EV_INT_solid, SOLID_BBOX)     entity_set_int(wall, EV_INT_movetype, MOVETYPE_FLY)     // zomg! }
and now I'm wondering.. what's wrong with it?
Basic-Master is offline
Send a message via ICQ to Basic-Master Send a message via MSN to Basic-Master
Zenith77
Veteran Member
Join Date: Aug 2005
Old 11-05-2005 , 13:27  
Reply With Quote #5

Code:
vRetVector[0] = 0.0


I dont get why you set the x angle to 0 ? Maybe thats problem....
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 11-05-2005 , 14:32  
Reply With Quote #6

Correct, EV_VEC_angles will only change the model's angle. To actually rotate the wall to represent the change you will have to modify the mins/maxs and absmis/absmax. Good luck cacluating that one. ;-)
XxAvalanchexX is offline
cTn
Senior Member
Join Date: Oct 2005
Old 11-05-2005 , 14:59  
Reply With Quote #7

common people ... this plugin can be moore bad and mega fun for admins on server ... someone go to A place on dust2 and whata hell? big wall blahahahhahah
__________________
cTn is offline
Send a message via ICQ to cTn Send a message via MSN to cTn
Basic-Master
Veteran Member
Join Date: Apr 2005
Location: hello pm
Old 11-05-2005 , 15:10  
Reply With Quote #8

okay I wrote a quite simple plugin, it could be useful and someone could convert it into a "real" plugin, here's the source:
Code:
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> #include <engine> #define PLUGIN "Wall" #define VERSION "1.0" #define AUTHOR "Basic-Master" public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     register_clcmd("amx_wall", "cmdWall")     register_clcmd("amx_wallrotate", "cmdGaben") } public cmdWall(id) {     new wall = create_entity("func_wall")     entity_set_string(wall, EV_SZ_classname, "wall")     entity_set_model(wall, "models/wall.mdl") // I found it somewhere in the forums     // Set size and absmin+absmax values     new Float:mins[3]     new Float:maxs[3]     mins[0] = -90.0     mins[1] = -10.0     mins[2] = -20.0     maxs[0] = 90.0     maxs[1] = 10.0     maxs[2] = 75.0     entity_set_vector(wall, EV_VEC_mins, mins)     entity_set_vector(wall, EV_VEC_maxs, maxs)     entity_set_vector(wall, EV_VEC_absmin, mins)     entity_set_vector(wall, EV_VEC_absmax, maxs)     // Set angle     mins[0] = 0.0     mins[1] = 90.0     mins[2] = 0.0     entity_set_vector(wall, EV_VEC_angles, mins)     // Get user origin     new Float:someOrigin[3]     entity_get_vector(id, EV_VEC_origin, someOrigin)     // You can offset the origin here.     new offset = 200     new Float:adjustPos[3]     velocity_by_aim(id, offset, adjustPos)     // This prevents the wall from spawning in the current position of the user and make it spawn farther away from the user.     someOrigin[0] += adjustPos[0]      someOrigin[1] += adjustPos[1]     someOrigin[2] += adjustPos[2]     entity_set_origin(wall, someOrigin)     // Set other values     entity_set_int(wall, EV_INT_solid, SOLID_BBOX)     entity_set_int(wall, EV_INT_movetype, MOVETYPE_FLY)     // zomg! } public cmdGaben(id) {     new target, body     get_user_aiming(id, target, body)     if (target != 0) {         new class[32]         entity_get_string(target, EV_SZ_classname, class, 31)         if (equali(class, "wall")) {             new Float:tmp             new Float:mins[3]             new Float:maxs[3]             entity_get_vector(target, EV_VEC_mins, mins)             tmp = mins[1]             mins[1] = mins[0]             mins[0] = tmp                      entity_get_vector(target, EV_VEC_maxs, maxs)             tmp = maxs[1]             maxs[1] = maxs[0]             maxs[0] = tmp                             entity_set_vector(target, EV_VEC_mins, mins)             entity_set_vector(target, EV_VEC_maxs, maxs)             entity_set_vector(target, EV_VEC_absmin, mins)             entity_set_vector(target, EV_VEC_absmax, maxs)                         entity_get_vector(target, EV_VEC_angles, mins)                  mins[1] = floatadd(mins[1], 90.0)             if (floatcmp(mins[1], 360.0) >= 0)                 mins[1] = 0.0             entity_set_vector(target, EV_VEC_angles, mins)                         entity_set_int(target, EV_INT_solid, SOLID_BBOX)         }     } }
Basic-Master is offline
Send a message via ICQ to Basic-Master Send a message via MSN to Basic-Master
Ingram
Veteran Member
Join Date: May 2004
Old 11-05-2005 , 15:33  
Reply With Quote #9

Code:
pev(ent,pev_origin,entorigin) set_pev(ent,pev_v_angle,angles) set_pev(ent,pev_angles,angles) entity_set_origin(ent, entorigin)
its with fakemeta(just change to engine if u want), but i remember it working. Not sure if u actually have to set the origin tho.
Ingram is offline
Zenith77
Veteran Member
Join Date: Aug 2005
Old 11-05-2005 , 16:33  
Reply With Quote #10

Quote:
Originally Posted by JJkiller
Code:
pev(ent,pev_origin,entorigin) set_pev(ent,pev_v_angle,angles) set_pev(ent,pev_angles,angles) entity_set_origin(ent, entorigin)
its with fakemeta(just change to engine if u want), but i remember it working. Not sure if u actually have to set the origin tho.
1. Fakemeta > engine

2. Please tell me why would you not have to set the origin....
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
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 22:17.


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