[pre release] Turret Behavior

Post your completed addons to share with the community

Post » Thu Sep 01, 2011 8:02 pm

Hello everyone! I'm here with my second behavior, this time the turret.
This is just a pre-release for you guys to comment and see if I forgot anything and make feature requests and change requests. Some things don't work, like the "is rotating" condition, or the "when not aiming" property. I'm just rushing this out the door because I don't have much time to work on it, but as you can see, the major stuff is done.

I have included an example with the file, which you can also preview, live, at http://dl.dropbox.com/u/39044660/Turret/index.html, courtesy of dropbox

The link for the behavior and example:
Download Turret Behavior

Remember the behavior is not optimized, therefore might run sluggishly for big projects.
Also, this is a behavior, not a plugin, so it should be extracted to the BEHAVIORS folder, under a "turret" folder of the appropriate name.Fimbul2011-09-01 20:04:45
B
35
S
8
G
8
Posts: 532
Reputation: 6,868

Post » Fri Sep 02, 2011 6:41 am

Updated - use the link above to grab the new version
Added: condition: pick closest object
this will pick the closest object within the arc/range specified.
Added: condition: is ready to fire
true when the object is facing its target, within X degrees.Fimbul2011-09-02 06:42:38
B
35
S
8
G
8
Posts: 532
Reputation: 6,868

Post » Fri Sep 02, 2011 8:16 am

that's really great. i tried this with logic blocks, but it was a mess. thanks for posting your work.

but you should change the first line in the "License.txt" ;)
B
11
S
3
G
2
Posts: 15
Reputation: 1,569

Post » Fri Sep 02, 2011 4:48 pm

Checked it out on your example page, excellent work! I'm intending to test this as soon as possible.
B
25
S
5
G
5
Posts: 138
Reputation: 5,638

Post » Sat Sep 03, 2011 12:27 pm

Um.. If I add the turret behavior to my turret sprite, then add event for the turret sprite--> Check for object within range, then add action: Set turret target to "Ship" Preview windows goes all gray. If I delete the turret behavior, the preview screen shows the game finely.

The turret behav. example capx also gives a grey preview window. mercy2011-09-03 12:30:26
B
25
S
5
G
5
Posts: 138
Reputation: 5,638

Post » Sat Sep 03, 2011 4:44 pm

that's strange. You mean the original, unmodified example that goes with the file also makes the screen go gray?

I'll have to check this, but I can't work on it til monday!
B
35
S
8
G
8
Posts: 532
Reputation: 6,868

Post » Sun Sep 04, 2011 1:33 pm

By invoking major functions, check within range, etc. it gives gray preview in firefox 5.1.
B
25
S
5
G
5
Posts: 138
Reputation: 5,638

Post » Sun Sep 04, 2011 5:38 pm

Does it work in chrome / firefox 3.6 / ie?
B
35
S
8
G
8
Posts: 532
Reputation: 6,868

Post » Sun Sep 04, 2011 9:52 pm

If you get the "grey preview", hit ctrl+shift+j in most browsers to open the error console - if you copy/paste any error messages out from that, it's always handy for the dev to know.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Sun Sep 04, 2011 10:14 pm

Thanks for the behavior Fimbul.
B
31
S
6
G
7
Posts: 140
Reputation: 5,983

Next

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 1 guest