Misfiring Timer

Questions, comments and discussion about the Game Editor development.

Misfiring Timer

Postby bamby1983 » Wed Jan 16, 2013 2:47 am

I created a timer that is activated when two actors collide. While the collision and the corresponding timer code work properly, the timer seems to be executing the same code when my actor walks through a small area on the other end of the screen. The region is too far away for there to possibly be a collision and I have confirmed that the collision does not occur (I added a sound to the collision code and it did not play when this issue occurred). It appears that something is causing the timer to fire when the actor walks through this region on the screen. There are no actors and nothing else calls the timer, so I'm not sure why this is occurring. Here are the relevant extracts of the code I have so far.

I'm not sure if it matters but the timer below was originally created with a delay of 250 ms and is being reassigned a new delay value programatically in the following code.


Collision Event Code:
Code: Select all
if (statsUnit_1[1]<1) // Capping the maximum delay at 1 second
    CreateTimer("Waypoint", "Delay Waypoint", statsUnit_1[1]*300);
else
    CreateTimer("Waypoint", "Delay Waypoint", 1000);



Timer Code:
Code: Select all
    PlaySound2("data/Event_Accomplished.wav", 0.04, 1, 0);
    ChangeAnimation("Waypoint", "Waypoint_Expand", FORWARD);
    Speech.animpos+=1;
    ChangeTransparency("Btn_Speech_Next", 0);



Animation Finish Event Code:
Code: Select all
ChangeTransparency("Event Actor", 1);
ChangeAnimation("Event Actor", "Waypoint", FORWARD);
DestroyTimer("Delay Waypoint");
bamby1983
 
Posts: 112
Joined: Tue Jul 31, 2012 11:36 pm
Score: 8 Give a positive score

Re: Misfiring Timer

Postby skydereign » Wed Jan 16, 2013 3:18 am

The most likely thing is that you are missing something. Can you post the ged showing the problem?
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Misfiring Timer

Postby bamby1983 » Thu Jan 17, 2013 1:35 am

Sure, the ged file is attached.
Attachments
Training Level.ged
(49.89 KiB) Downloaded 179 times
bamby1983
 
Posts: 112
Joined: Tue Jul 31, 2012 11:36 pm
Score: 8 Give a positive score

Re: Misfiring Timer

Postby skydereign » Thu Jan 17, 2013 1:57 am

That ged won't work properly without graphics. The waypoint cannot collide, and therefore the timer is never activated. If you don't want to release your actual game data, then I suggest making a small version of the problem (which you may find the solution for your problem by doing so) and posting it here.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Misfiring Timer

Postby bamby1983 » Thu Jan 17, 2013 3:56 am

I don't mind releasing the actual game data. It's just that the game is nearly 9 MB and the attachment limit is 2 MB here.

I'll try to upload the game online somewhere and post the link here.
bamby1983
 
Posts: 112
Joined: Tue Jul 31, 2012 11:36 pm
Score: 8 Give a positive score

Re: Misfiring Timer

Postby skydereign » Thu Jan 17, 2013 3:59 am

You could also remove all the irrelevant actors, and save as to create a new file (in a different directory, so the data directory only has the relevant graphics). And upload that.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Misfiring Timer

Postby bamby1983 » Thu Jan 17, 2013 4:27 am

Looks like the forums allowed me to upload my attachment here! Cool! :)

Steps to replicate this issue:
Open the file "Training Level.ged"
Enter Game Mode
A speech box will pop up less than 2 seconds after the game launches. Follow the instructions in this speech box
Except for one instance, you'll find yourself simply be clicking the "Next" button
There is a small spot somewhere in the area within the red circle (please refer to the attached screenshot titled "Area.png") that triggers the timer event even though it is not supposed to work that way. The timer event is ONLY supposed to be triggered when the soldier either collides with the waypoint actor (it will appear once you click through speech bubbles a few times) or if he is already standing in the region within the waypoint. When this occurs, you'll see the waypoint explode outwards and a sound clip will play.
Attachments
Area.png
Tact.zip
(7.57 MiB) Downloaded 213 times
bamby1983
 
Posts: 112
Joined: Tue Jul 31, 2012 11:36 pm
Score: 8 Give a positive score

Re: Misfiring Timer

Postby skydereign » Thu Jan 17, 2013 5:31 am

The reason is your tree actor has a collision event with the soldier. It creates waypoint's timer. Remove that, and it should work.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Misfiring Timer

Postby bamby1983 » Thu Jan 17, 2013 12:38 pm

Aaah thank you! I dunno how that happened but I probably had the tree actor selected and thought I was working on the waypoint. :(
bamby1983
 
Posts: 112
Joined: Tue Jul 31, 2012 11:36 pm
Score: 8 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest