It hurts...
by Zilla · in Torque X Platformer Kit · 11/03/2007 (2:24 am) · 4 replies
I was placing objects in my scene where the player gets hurt when he touches them and he will lose one "pepper".
These objects have the same functionality like the drills with the difference that these objects don't move (cactuses, fires etc.).
I was "copying" the scene objects, spawners, triggers etc. of the drills and inserted my own graphics (cactuses, fires etc.) and I set the variables for the movements in the DrillActorComponent to zero so that these objects won't move like the drills.
Is there a better solution because there are quite a lot of these objects in the scene?
These objects have the same functionality like the drills with the difference that these objects don't move (cactuses, fires etc.).
I was "copying" the scene objects, spawners, triggers etc. of the drills and inserted my own graphics (cactuses, fires etc.) and I set the variables for the movements in the DrillActorComponent to zero so that these objects won't move like the drills.
Is there a better solution because there are quite a lot of these objects in the scene?
#2
This is exactly what I was trying to do. But after a few experiments, where I deleted the wrong "bulk" from the "new" DrillActorComponent because I didn't understand everything in this component, I decided to use the DrillActorComponent with a lot of unused code :-(
11/03/2007 (1:45 pm)
Thank, you, ShawnQuote:For what you are doing, you should create your own component instead of just setting the movement of the DrillActorComponent to 0, it has a lot of bulk that wouldn't be needed for a simple damage component.
This is exactly what I was trying to do. But after a few experiments, where I deleted the wrong "bulk" from the "new" DrillActorComponent because I didn't understand everything in this component, I decided to use the DrillActorComponent with a lot of unused code :-(
#3
From the API docs:
Yes, the above typo is in the API docs.. sorry, thtts myw faultsx. ;)
11/06/2007 (11:38 pm)
There's actually a component in the framework that does this for you. It's called the HazardComponent and it has a public Damage property.From the API docs:
Quote:
A component to be added to a scene object. The trigger will deal a specific amount of damage to any Actors that enter the scene object's boundaries. For instantly killing Actors, use a KillTriggerComponent, rathr than a HazardComponent.
Damage - The amount of damage to attempt to deal to Actors that enter the trigger.
Yes, the above typo is in the API docs.. sorry, thtts myw faultsx. ;)
Torque Owner Shawn Simas
Bigfoot Studios
create a new spawner object, and set it to spawn the previously made item. Copy and paste this spawner wherever you want it to be, it will automatically 'spawn' one of those objects with all the settings you put.
Edit: For what you are doing, you should create your own component instead of just setting the movement of the DrillActorComponent to 0, it has a lot of bulk that wouldn't be needed for a simple damage component.