Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to make a hammer destroy a padlock (or other enteties)
Quotentote Offline
Member

Posts: 118
Threads: 23
Joined: Dec 2011
Reputation: 11
#1
How to make a hammer destroy a padlock (or other enteties)

hi there.

i got another question.
how do i scritp that hammer-xyz destroys padlock-xyz?

PHP Code: (Select All)
void OnStart()
{
AddUseItemCallback("""torturekey""tortureroom""unlock_door1"true);
}

void unlock_door1(string &in asItemstring &in asEntity)
{
    
SetPropHealth("tortureroom"0.0f);


dont be confused by the names^^ torturekey=hammer tortureroom=padlock Wink

so how do i script this, that the padlock will be destroyed when using the hammer on it?

ty
quotentote
12-20-2011, 03:29 PM
Find
Dobbydoo Offline
Member

Posts: 50
Threads: 6
Joined: Aug 2011
Reputation: 0
#2
RE: How to make a hammer destroy a padlock (or other enteties)

(12-20-2011, 03:29 PM)Quotentote Wrote: hi there.

i got another question.
how do i scritp that hammer-xyz destroys padlock-xyz?

PHP Code: (Select All)
void OnStart()
{
AddUseItemCallback("""torturekey""tortureroom""unlock_door1"true);
}

void unlock_door1(string &in asItemstring &in asEntity)
{
    
SetPropHealth("tortureroom"0.0f);


dont be confused by the names^^ torturekey=hammer tortureroom=padlock Wink

so how do i script this, that the padlock will be destroyed when using the hammer on it?

ty
quotentote

The code you have should already work? Or is it the animation you're looking for? Then you should check out the prison_south.hps Smile

(This post was last modified: 12-20-2011, 03:38 PM by Dobbydoo.)
12-20-2011, 03:37 PM
Find
Quotentote Offline
Member

Posts: 118
Threads: 23
Joined: Dec 2011
Reputation: 11
#3
RE: How to make a hammer destroy a padlock (or other enteties)

no its not working :/ thats why im asking =)
or is it an special padlock i have to use? <.<

how animations work i already know (should be like using a crowbar)
(This post was last modified: 12-20-2011, 03:43 PM by Quotentote.)
12-20-2011, 03:42 PM
Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#4
RE: How to make a hammer destroy a padlock (or other enteties)

(12-20-2011, 03:42 PM)Quotentote Wrote: no its not working :/ thats why im asking =)
or is it an special padlock i have to use? <.<

how animations work i already know (should be like using a crowbar)


I would try making it inactive and spawn a padlock broken one right on the original padlock. I'm not sure the padlock use's health.

12-20-2011, 03:56 PM
Find
Quotentote Offline
Member

Posts: 118
Threads: 23
Joined: Dec 2011
Reputation: 11
#5
RE: How to make a hammer destroy a padlock (or other enteties)

you mean something like that?

PHP Code: (Select All)
    void VOIDNAME (string &in asItemstring &in asEntity)
            {
            
SetEntityActive("BROKENPADLOCK",true);
            
SetEntityActive("PADLOCK",false);
            
RemoveItem("HAMMER");
            } 
12-20-2011, 04:03 PM
Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#6
RE: How to make a hammer destroy a padlock (or other enteties)

(12-20-2011, 04:03 PM)Quotentote Wrote: you mean something like that?

PHP Code: (Select All)
    void VOIDNAME (string &in asItemstring &in asEntity)
            {
            
SetEntityActive("BROKENPADLOCK",true);
            
SetEntityActive("PADLOCK",false);
            
RemoveItem("HAMMER");
            } 
Pretty much, maybe add a sound or something?

12-20-2011, 04:12 PM
Find
Quotentote Offline
Member

Posts: 118
Threads: 23
Joined: Dec 2011
Reputation: 11
#7
RE: How to make a hammer destroy a padlock (or other enteties)

i add sounds when everything works ^^

ty for that hint i'll let my boyfriend test it later ^^

12-20-2011, 06:02 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#8
RE: How to make a hammer destroy a padlock (or other enteties)

(12-20-2011, 06:02 PM)Quotentote Wrote: i add sounds when everything works ^^

ty for that hint i'll let my boyfriend test it later ^^

Rolleyes Here's a tip that can help speed up the process for testing:

When using a profile enabled for development, ScriptDebugOn() returns true. If you check for when it returns true, for example, in OnStart(), you can temporarily set up the game environment to quickly and easily accomplish a task by giving the player items and teleporting the player to a specific area, etc.

Tutorials: From Noob to Pro
(This post was last modified: 12-20-2011, 06:18 PM by Your Computer.)
12-20-2011, 06:18 PM
Website Find
Quotentote Offline
Member

Posts: 118
Threads: 23
Joined: Dec 2011
Reputation: 11
#9
RE: How to make a hammer destroy a padlock (or other enteties)

thats not the problem.... the problem is the waterlurker....im so afraid of these things that i dont WANT to test it xD i feel so silly by saying this but i dont change anything in my scripts. they work and this should remain so ^^

i also feel silly by creating a new thread everyday, but all of you guys make the start in scripting so much easier.

thank you for that i gonna test the script later this evening
12-20-2011, 06:28 PM
Find




Users browsing this thread: 1 Guest(s)