Need help with character collisions
Moderators: adeyke, VampD3, eriqchang, Angelus3K
-
- Royal Servant Status
- Posts: 116
- Joined: Tue May 04, 2004 3:07 pm
- Contact:
Need help with character collisions
I'm trying to make it so that when a character touches the main character, it kills you. It's successful, I've used the IsCollidingWithChar function and like I say, everything works. It's just that he isn't close by. I imagine it has to do with transparencies. Is there any way around this? I don't want to shrink the ego's transparency, as I use it to maintain sideways animation and the like. Blah blah.
Also, I'm using the FollowCharacter function to have the thing chase my little ego man, but sometimes it goes around him and then comes back. Can that be fixed, either? I hope this makes sense. Thanks in advance.
- Tom
Also, I'm using the FollowCharacter function to have the thing chase my little ego man, but sometimes it goes around him and then comes back. Can that be fixed, either? I hope this makes sense. Thanks in advance.
- Tom
-
- Royal Servant Status
- Posts: 116
- Joined: Tue May 04, 2004 3:07 pm
- Contact:
-
- Royal Servant Status
- Posts: 116
- Joined: Tue May 04, 2004 3:07 pm
- Contact:
Ok. I can't figure out how to fine tune it. I can do
but I need to make it so if cTut is overlapping cEgo by 21 pixels, something happens. How do I do that?
OK. Problem. Here.
works. but if I change it to
It doesn't work anymore. Returns: Error LINE 55 (which is the GetGraphicalVariable?!?!) Type mismatch: Cannot convert 'character*' to 'int'
WHY WHAT ARRRRRRR
Code: Select all
if (AreThingsOverlapping(cEgo, cTut)) {
//do stuff here
}
OK. Problem. Here.
Code: Select all
// script for Room: Repeatedly execute
if (GetGraphicalVariable("virustouch")==1)
if (cEgo.IsCollidingWithChar(cTut)==1) {
//Death animation goes here
cEgo.ChangeRoom(4);
PlayMusic(5);
gIconbar.Visible = (false);
lblDeath.Text = ("Feeling a bit under the weather?");
gDeath.Visible=(true);
gDeath.SetPosition(160, 0);
}
Code: Select all
// script for Room: Repeatedly execute
if (GetGraphicalVariable("virustouch")==1)
if (AreThingsOverlapping(cTut, cEgo)) {
//Death animation goes here
cEgo.ChangeRoom(4);
PlayMusic(5);
gIconbar.Visible = (false);
lblDeath.Text = ("Feeling a bit under the weather?");
gDeath.Visible=(true);
gDeath.SetPosition(160, 0);
}
WHY WHAT ARRRRRRR
Try this:
First of all, in order to specify how large the overlapping area is allowed to be, you must put a value after the parentheses. Secondly, the function doesn't seem to use the object-oriented approach most other functions use. So you must either fill in the character ID's in there or the number of the characters.
Code: Select all
// script for Room: Repeatedly execute
if (GetGraphicalVariable("virustouch")==1)
if (AreThingsOverlapping(TUT, EGO)>21) {
//Death animation goes here
cEgo.ChangeRoom(4);
PlayMusic(5);
gIconbar.Visible = (false);
lblDeath.Text = ("Feeling a bit under the weather?");
gDeath.Visible=(true);
gDeath.SetPosition(160, 0);
}
-
- Royal Servant Status
- Posts: 116
- Joined: Tue May 04, 2004 3:07 pm
- Contact: