|
Post by RG on Feb 26, 2007 17:05:05 GMT -5
In his thread, ultra tree 85 asked how to set up a soda, or cola machine like the ones in DNMP. This is a mini-tutorial on how to set it up. BTW, the cola_machine is an excellent example of a brush with enitities that you would want to make into a prefab by following the instructions in the pre-fab tut. Your brush is just a box that is textured with the cola_machine shader on it. Part 1: A simple cola_machine that just keeps dispensing health(or whatever) without running out: Start with an area_switch and use the appropriate settings for a repeating manual punch switch that is quiet. This switch will signal these two entities. Insert a plain_sound entity so that it will activate the soda_machine sound. Insert a timer entity to count off 1 second and then activate a player_give entity, which will dispense health, etc. until it reaches the max_triggers you set, which would be infinite(-1) here. Then, from your player_give entity, from your triggers_left outpin option choose your area_switch. I'll work up part 2, where the machine runs out, makes a different noise, and Duke curses, soon. Let me know if you can or cannot follow this tut so I can amend it, if necessary. Good Luck!
|
|
|
Post by ultra tree 85! on Feb 26, 2007 23:30:03 GMT -5
Thanks a lot! I got the cola machine set up with the sound and everything, and the timer and player_give entities! I'm looking forward to part 2 of the tutorial!
|
|
|
Post by RG on Feb 27, 2007 17:25:44 GMT -5
Hey, guys. Here it is.
Part 2:
A cola machine that dispenses a pre-set number of power-ups and then issues an 'empty' sound to which Duke curses.
Presuming you have already built the above machine, you now need to add a second area_switch with similar properties to the first and in the exact same position, but it will not start_active. Switch2 will signal these two entities. Insert another plain_sound enity so that it will play the key_error sound from \sounds\e01\other directory. Insert a voice_over entity so that it will play the \sounds\e01\voice\du_goddam.ogg. with a 1 second delay. Next, add a 'not' logic entity and for its output choose your Switch2. Then, go back to your player_give entity, adjust the number of max_triggers to a finite number like 5 or 10, and add your 'not' entity to your triggers_left outpin, making sure you do not erase the outpin attachment to the first switch. That should do it!
Note: Should you decide you want to be able to destroy the machine, just put your brush as a child of(under) a breakable_adv entity, place another 'not' entity there to de-activate the first switch(Switch1) and have the breakable_adv outpin, broken, input the 'not' entity.
Please test this out and let me know if there are any errors in the set up so I can correct them.
Good luck, and remember to post your questions in this forum so we have a single place to find help. Cheers! ;D
|
|
|
Post by prowler4 on Feb 28, 2007 8:00:58 GMT -5
Thanks for the great tutorial RG! I changed the name to show this is a tutorial and stickyed it to the top of the thread list so others will be able to find it easily. Thanks again.
|
|
|
Post by RG on Feb 28, 2007 18:33:34 GMT -5
Hey, thanks, Prowler. ;D
|
|