Quotentote
Member
Posts: 118
Threads: 23
Joined: Dec 2011
Reputation:
11
|
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?
void OnStart() { AddUseItemCallback("", "torturekey", "tortureroom", "unlock_door1", true); }
void unlock_door1(string &in asItem, string &in asEntity) { SetPropHealth("tortureroom", 0.0f); }
dont be confused by the names^^ torturekey=hammer tortureroom=padlock
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 |
|
Dobbydoo
Member
Posts: 50
Threads: 6
Joined: Aug 2011
Reputation:
0
|
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?
void OnStart() { AddUseItemCallback("", "torturekey", "tortureroom", "unlock_door1", true); }
void unlock_door1(string &in asItem, string &in asEntity) { SetPropHealth("tortureroom", 0.0f); }
dont be confused by the names^^ torturekey=hammer tortureroom=padlock
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
(This post was last modified: 12-20-2011, 03:38 PM by Dobbydoo.)
|
|
12-20-2011, 03:37 PM |
|
Quotentote
Member
Posts: 118
Threads: 23
Joined: Dec 2011
Reputation:
11
|
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 |
|
flamez3
Posting Freak
Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation:
57
|
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 |
|
Quotentote
Member
Posts: 118
Threads: 23
Joined: Dec 2011
Reputation:
11
|
RE: How to make a hammer destroy a padlock (or other enteties)
you mean something like that?
void VOIDNAME (string &in asItem, string &in asEntity) { SetEntityActive("BROKENPADLOCK",true); SetEntityActive("PADLOCK",false); RemoveItem("HAMMER"); }
|
|
12-20-2011, 04:03 PM |
|
flamez3
Posting Freak
Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation:
57
|
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?
void VOIDNAME (string &in asItem, string &in asEntity) { SetEntityActive("BROKENPADLOCK",true); SetEntityActive("PADLOCK",false); RemoveItem("HAMMER"); }
Pretty much, maybe add a sound or something?
|
|
12-20-2011, 04:12 PM |
|
Quotentote
Member
Posts: 118
Threads: 23
Joined: Dec 2011
Reputation:
11
|
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 |
|
Your Computer
SCAN ME!
Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation:
235
|
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 ^^
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.
(This post was last modified: 12-20-2011, 06:18 PM by Your Computer.)
|
|
12-20-2011, 06:18 PM |
|
Quotentote
Member
Posts: 118
Threads: 23
Joined: Dec 2011
Reputation:
11
|
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 |
|
|