Raised This Month: $ Target: $400
 0% 

how to create func_door_rotating triggered by func_button


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 04-28-2011 , 06:49   how to create func_door_rotating triggered by func_button
Reply With Quote #1

so yeah, i want a plugin to create a surf_ski_2 style jail, i got func_door_rotating and func_button to spawn but thats it

PHP Code:
iEntity create_entity"func_door_rotating" )
    if( !
is_valid_entiEntity ) ) {
        
log_amx"There was an error with creating")
        return 
0;
    }
    
entity_set_stringiEntityEV_SZ_classname"func_door_rotating")
    
entity_set_intiEntityEV_INT_movetypeMOVETYPE_FLY)
    
entity_set_intiEntityEV_INT_solidSOLID_BBOX)
    
entorigin[0] = jailLocation[0] +0.5
    entorigin
[1] = jailLocation[1] -0.5
    entorigin
[2] = jailLocation[2] -100//+0.5
    
entity_set_origin(iEntityentorigin
    
entity_set_model(iEntity,"models/fakejail/jail_floor.mdl")
    
entity_set_vector(iEntityEV_VEC_anglesFloat:{ 0.00.0 0.0  })
    
entity_set_size(iEntity,Float:{ -155.0,-155.0,-2.5}, Float:{ 155.0,155.0,2.5}  )
    
entity_set_string(iEntityEV_SZ_target"jbutton")
    
entity_set_string(iEntityEV_SZ_targetname"jdoor")
    
entity_set_float(iEntityEV_FL_speed100.0)


    
    
iEntity create_entity"func_button" )
    if( !
is_valid_entiEntity ) ) {
        
log_amx"There was an error with creating")
        return 
0;
    }
    
    
entity_set_stringiEntityEV_SZ_classname"func_button")
    
entity_set_intiEntityEV_INT_movetypeMOVETYPE_NONE)
    
entity_set_intiEntityEV_INT_solidSOLID_BBOX)
    
entorigin[0] = jailLocation[0]
    
entorigin[1] = jailLocation[1]
    
entorigin[2] = jailLocation[2] +178
    entity_set_origin
(iEntityentorigin
    
entity_set_model(iEntity,"models/fakejail/jail_button.mdl")
    
entity_set_vector(iEntityEV_VEC_anglesFloat:{ 0.00.0 0.0  })
    
entity_set_size(iEntity,Float:{ -16.0,-16.0,0.0}, Float:{ 16.0,16.0,32.0}  )
    
entity_set_string(iEntityEV_SZ_target"jdoor")
    
entity_set_string(iEntityEV_SZ_targetname"jbutton"
also id like the door to be touch activated, i found that in valve hammer theres a "flags" tab in object properties, where you could set that, but how to do that in code

pictures of flags that need to be set:
http://www.upload.ee/image/1303364/nupp.PNG
http://www.upload.ee/image/1303366/luuk.PNG

Last edited by jimaway; 04-28-2011 at 07:26.
jimaway is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 04-28-2011 , 08:06   Re: how to create func_door_rotating triggered by func_button
Reply With Quote #2

Those flags listed in hammer are stored in EV_INT_spawnflags, it holds a bitsum.

Some bitsums can be found in includes/hlsdk_const.inc at the bottom, just search for func_button and func_door_rotating and you'll find what you need.
__________________
Hunter-Digital is offline
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 04-28-2011 , 08:35   Re: how to create func_door_rotating triggered by func_button
Reply With Quote #3

thanks for that, but i still didnt get the door working

and the hlsdk_const.inc didnt have "Touch activates in it"
jimaway is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 04-28-2011 , 08:45   Re: how to create func_door_rotating triggered by func_button
Reply With Quote #4

It doesn't need to, you just don't set SF_DOOR_USE_ONLY and it's understandable that you can also touch it to open.

The rest, I never needed to create doors so I don't know.
__________________
Hunter-Digital is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-28-2011 , 08:59   Re: how to create func_door_rotating triggered by func_button
Reply With Quote #5

To understand how works a door, look at the HLSDK, jimaway.
__________________
Arkshine is offline
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 04-28-2011 , 10:27   Re: how to create func_door_rotating triggered by func_button
Reply With Quote #6

more help would be appriciated, im too inexperienced to find out my problem from hlsdk, tho i tried
jimaway is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-28-2011 , 11:18   Re: how to create func_door_rotating triggered by func_button
Reply With Quote #7

Using a plugin, hooking touch and using Ham_User or force_use.
Without using a plugin, not sure, I guess you will need a trigger entity so when a player touches it, this entity activates the door entity. Something like that.
__________________
Arkshine is offline
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 04-28-2011 , 14:52   Re: how to create func_door_rotating triggered by func_button
Reply With Quote #8

i havent even got the door working, how would hooking touch help me? only thing i got moving was the button that should open the door, dont ask me why it started moving (i even had entity spawnflag "SF_BUTTON_DONTMOVE")

Last edited by jimaway; 04-28-2011 at 14:56.
jimaway is offline
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 04-29-2011 , 07:41   Re: how to create func_door_rotating triggered by func_button
Reply With Quote #9

ok i got the func_door_rotating to work around Z axis ( tho i have entity_set_int(iEntity2, EV_INT_spawnflags, SF_DOOR_ROTATE_X) )

and if i use entity_set_int( iEntity2, EV_INT_movetype, MOVETYPE_PUSH) (the only movetype it works with properly) it crashes the game with fatal error when i get onto the door

the error is "Hit a func_door_rotating with no model (models/fakejail/jail_floor.mdl)" i also had same kind of error when i changed func_button to MOVETYPE_PUSH, any ideas?

edit: i got the door rotating on X axis with DispatchKeyValue(iEntity2, "spawnflags", "640") instead of setting EV_INT_spawnflags but it looks like only the model is rotating and the solid part is still in the same place, maby thats why i get the error when i touch the top part of the solid, any ideas?


more edit:
this is what i have now:
PHP Code:
    iEntity create_entity"func_button" )
    if( !
is_valid_entiEntity ) ) {
        
log_amx"There was an error with creating")
        return 
0;
    }
    
DispatchKeyValue(iEntity,"speed","5")
    
DispatchKeyValue(iEntity,"wait","3")
    
DispatchKeyValue(iEntity,"rendercolor","0 0 0")
    
DispatchKeyValue(iEntity,"renderamt","0")
    
DispatchKeyValue(iEntity,"targetname","jbutton")
    
DispatchKeyValue(iEntity,"angles","0 0 0")
    
DispatchKeyValue(iEntity,"target","jdoor")
    
DispatchKeyValue(iEntity,"health","0")
    
DispatchKeyValue(iEntity"lip""0")
    
DispatchKeyValue(iEntity"sounds""2")
    
DispatchKeyValue(iEntity"delay""0")
    
DispatchKeyValue(iEntity"locked_sound""0")
    
DispatchKeyValue(iEntity"unlocked_sound""0")
    
DispatchKeyValue(iEntity"locked_sentence""0")
    
DispatchKeyValue(iEntity"unlocked_sentence""0")
    
DispatchKeyValue(iEntity"spawnflags""319")
    
DispatchKeyValue(iEntity"classname""func_button")
    
DispatchKeyValue(iEntity"model""models/fakejail/jail_button.mdl")
    
DispatchSpawn(iEntity)
    
    
entity_set_intiEntityEV_INT_movetypeMOVETYPE_NONE)
    
entity_set_intiEntityEV_INT_solidSOLID_BBOX)
    
entorigin[0] = jailLocation[0]
    
entorigin[1] = jailLocation[1]
    
entorigin[2] = jailLocation[2] +178
    entity_set_origin
(iEntityentorigin
    
entity_set_size(iEntity,Float:{ -16.0,-16.0,0.0}, Float:{ 16.0,16.0,32.0}  )
    
    new 
iEntity2 create_entity"func_door_rotating" )
    if( !
is_valid_entiEntity2 ) ) {
        
log_amx"There was an error with creating")
        return 
0;
    }
    
entity_set_size(iEntity2,Float:{ -155.0,-155.0,-4.5}, Float:{ 155.0,155.0,4.5}  )
    
entorigin[0] = jailLocation[0//+0.5
    
entorigin[1] = jailLocation[1//-0.5
    
entorigin[2] = jailLocation[2] -100//+0.5

    
DispatchKeyValue(iEntity2"angles""0 0 0")
    
DispatchKeyValue(iEntity2,"movesnd","3")
    
DispatchKeyValue(iEntity2,"stopsnd","4")
    
DispatchKeyValue(iEntity2,"wait","3")
    
DispatchKeyValue(iEntity2,"rendermode","2")
    
DispatchKeyValue(iEntity2,"renderamt","255")
    
DispatchKeyValue(iEntity2,"rendercolor","0 0 0")
    
DispatchKeyValue(iEntity2,"distance","90")
    
DispatchKeyValue(iEntity2,"dmg","0")
    
DispatchKeyValue(iEntity2"targetname""jdoor")
    
DispatchKeyValue(iEntity2"speed""100")
    
DispatchKeyValue(iEntity2"lip""0")
    
DispatchKeyValue(iEntity2"dmg""0")
    
DispatchKeyValue(iEntity2"target""jbutton")
    
DispatchKeyValue(iEntity2"delay""0")
    
DispatchKeyValue(iEntity2"health""0")
    
DispatchKeyValue(iEntity2"locked_sound""0")
    
DispatchKeyValue(iEntity2"unlocked_sound""0")
    
DispatchKeyValue(iEntity2"locked_sentence""0")
    
DispatchKeyValue(iEntity2"unlocked_sentence""0")
    
DispatchKeyValue(iEntity2"renderfx""0")
    
DispatchKeyValue(iEntity2"model""models/fakejail/jail_floor.mdl")
    
DispatchKeyValue(iEntity2"classname""func_door_rotating")
    
DispatchKeyValue(iEntity2"spawnflags""640")
    
DispatchSpawn(iEntity2)
    
entity_set_intiEntity2EV_INT_movetypeMOVETYPE_PUSH)
    
entity_set_intiEntity2EV_INT_solidSOLID_BBOX)
    
entity_set_origin(iEntity2entorigin
    
entity_set_size(iEntity2,Float:{ -155.0,-155.0,-4.5}, Float:{ 155.0,155.0,4.5}  ) 
only had a little improvement, button triggers the door now (for some reason it takes ages tho... like ~15+ minutes or so ) and i still get that fatal error when i stand on the door when it moves + the solid part still doesent move

id really like to get this to work so please, anyone whos experienced enough HELP meee

Last edited by jimaway; 04-29-2011 at 12:49.
jimaway is offline
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 04-30-2011 , 10:01   Re: how to create func_door_rotating triggered by func_button
Reply With Quote #10

is it possible to make the door and button in valve hammer and just import the .bsp somehow?
jimaway is offline
Reply



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 04:23.


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