About Store Forum Documentation Contact



Post Reply 
damage radius
Author Message
1991mirec Offline
Member

Post: #1
damage radius
Hi I was wondering if this could be done in a script. What I would like to be done is if when I activate the script I would like it to trigger
a damage radius as it is on the picture infront of the character and enemie AI targets that are in the radius will take damage. Here are some screen shots of what I thought would best explain this.

   


   
03-14-2014 02:55 PM
Find all posts by this user Quote this message in a reply
Tottel Offline
Member

Post: #2
RE: damage radius
Sure.

I assume you have some inheritance system.
What you could do is add a TakeDamage() function to your Chr baseclass. You can then call TakeDamage on any object that inherits from Chr (Player, AI,..).
To do so, you can do something like ObjGet() (I don't have Esenthel installed on this PC here, I'm not sure about the name) to get the objects in that area and cast to Chr class. If the cast is valid, call TakeDamage.
03-14-2014 06:39 PM
Find all posts by this user Quote this message in a reply
1991mirec Offline
Member

Post: #3
RE: damage radius
hi thank you tottel

the thing is that the obj (blue thing infront of the bird) is not created with capsul ball box or anything it s the same thing as pentagram in esenthel rpg2 but shae was changed.. so it doesn t have physics on it. how can i create or have obj like this(it will be invisible later on) created and any obj inside of it would receive damage.. i couldn t make this shaped rectangle with anything else... any advice???
03-14-2014 07:38 PM
Find all posts by this user Quote this message in a reply
Rubeus Offline
Member

Post: #4
RE: damage radius
That's a relatively simple shape. You could programatically create a mesh based on it's shape to feed to PhysX to check the collisions.
03-14-2014 09:53 PM
Find all posts by this user Quote this message in a reply
1991mirec Offline
Member

Post: #5
RE: damage radius
thank you rubeus.. but can you be little more specific maybe some part of the code.. i ll sure try something but you could help me a lot more with some part of the code at least some kind of the hint.. smile
03-14-2014 10:19 PM
Find all posts by this user Quote this message in a reply
Rubeus Offline
Member

Post: #6
RE: damage radius
You could create a mesh that fits the shape(see the dynamic mesh tutorial), then give a physbody part the newly created meshbase using createMesh. That would allow you to interface with the physics and create a callback, or however you wanted to do it.

Alternatively, you could create an approximate sized box, and when you check for objects, do a second check to see if they are within the more precise bounds of the area you want.

You could probably even get away with just using the box-unless you need it very precise.
03-14-2014 11:03 PM
Find all posts by this user Quote this message in a reply
Post Reply