How to Change Interactive Size of Actor ∆ or ≠ Image Size
worldranger
Member Posts: 10
Hi Community!
Getting into game dev here. Encounterd a hurdle I can't find (googled + search forum) a solution for...
I've got an actor I want to interact with another actor but I don't want the image size to be the discernible boundary for that actor.
How do i make the game treat the image as a smaller actor. In this case, I wish to make the interactive size smaller than the image the actor uses.
Appreciate the assistance!
Kind regards,
Worldranger
Getting into game dev here. Encounterd a hurdle I can't find (googled + search forum) a solution for...
I've got an actor I want to interact with another actor but I don't want the image size to be the discernible boundary for that actor.
How do i make the game treat the image as a smaller actor. In this case, I wish to make the interactive size smaller than the image the actor uses.
Appreciate the assistance!
Kind regards,
Worldranger
Best Answers
-
tatiang Posts: 11,949As was mentioned, magnitude may be the answer here. If you can describe a bit more about how your game works and/or post a screenshot, we can probably come up with a better way to do this.
Magnitude is a built-in math function in GameSalad:
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
-
RThurman Posts: 2,8801) Put the proximity sensor in the missile (not the target). And use an actor attribute (not game attribute) to record distance.
2) In the missile actor:
a) Rule: When a missile is near the target's center:
b) Spawn a detonation actor at the missile's location.
c) Blow up the missile (particles)
d) Destroy the missile actor
3) In the target actor:
a) Rule: When overlap/collides with the detonation actor
a1) do the destruction sequence for the target actor
4) In the detonation actor:
a) Rule: When overlap/collides with target actor
a1) After .5 seconds do a destruction sequence for detonation actor
Answers
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
http://forums.gamesalad.com/discussion/comment/384027/#Comment_384027
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
I've got to get it so the larger visible actor only destroy itself if/when its smaller ghost actor does so.
No idea how to do that! There must be a better way to do this without having to create duplicate actors all the time of different sizes!
Basicially I have a target that I am shooting with missiles. The graphic for the missiles is much large than the actual size of the missile should be. Therefore it was hitting too soon. I solved this by creating two ghost actors (smaller than both of the graphic actors but identical in everyway) that when interact with each other cause damage.
The problem I have now is that the larger graphic actor is still destroying itself too soon giving the impression that it didn't hit the target and exploded prematurely.
I wanted to use the distance'from attribute to let it only destroy itself if it had reach a certain distance and indeed technically graphically somewaht overlap the target ghost actor and only have the missile destory itself once its core had touched the target actor.
Does this make sense?
Why is the larger graphic actor destroying itself too soon? What rule are you using to achieve that?
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Currently There is a smaller invisible actor that follows the path of the larger actor. When the smaller actor collides with the target actor it causes damage.
I am trying to get the larger actor to NOT dissapear when it interacts with the target actor but only if/when its smaller invisible actor sibling collides with it.
Currently I am using a rule to say if it collides with the target actor it destroys itself.
I tried using the other code but when i'm not sure if its measuring from the center of the actors or what - either way it doesnt seem to be working!
Have you considered particles instead of a separate large actor for the special effects?
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
I guess that boolean would have the same issue.
I have considered particles but it just wouldn't look right for what I'm doing.
There must be a way to stipulate an 'overlap' situation.
Thanks for your input!
I've already implemented the timer delay as the only way I can get the Missile Effects to destroy itself. Problem being that it still self destructs if the graphic touches the target actor even if the target actor is not hit by the 'detonation actor'- this is not ideal as it can leed the player to think he either was hit and it didn't record the hit or that the missile is gone and then get hit by the 'detonator actor' thats invisible and still tracking him.
What do you by 'put the proximity sensor in the missile' we're talking about game coding here - there isn't actually a real 'proximity sensor'
This is how it WAS
game.Distance From = game.target X - self.Position.X , game.target y - self.Position.Y
Where Distance From is a Game Attribute Integer and self is the missile thats how its set up already.
I've now changed it to
self.Missile Distance From = game.target X - self.Position.X , game.target y - self.Position.Y
Ive set the destroy to when self.Missile Distance From = 0
then
Destroy this Actor.
But it seems that the actors just destroy themselves as soon as they are present - i think it has something to do with the math...
EXCELLENT THANK YOU EVERYONE!
I hope to show this project soon. Is there a good place to show off beta projects?
Glad to hear it's working! Nothing like crowdsourcing to solve problems, eh?
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User