71,669

Views

Beginner

Level

58

Comments

Abigayl's Interactive Tutorials (Part 2)

by Joe (Updated on 2012-07-21)


Tutorial 2 - Attributes, Saving/Loading, Kongregate API

 

CHANGES TO CURRENT STENCYL VERSION:

  • Game Center is now Dashboard
  • No longer need to make Actor Behaviors; can use "Events" tab instead
  • Now need to use "Add an Event" at the top left to make the headings
  • If using events, do not need to "Attach to Actor" (still needed with Behaviors though)

 

Liked this one? See them all!

Part 1: The Basics

Part 2: Attributes, Saving/Loading, Kongregate API

Part 3: Advanced Controls, Spawning

Part 4: Mouse-based Shooting, Collisions and HP

Part 5: Music, Screen Boundaries, Backgrounds, Power-ups and More

Part 6: Virtually Lagless Actors

Disclaimer: Use comments to provide feedback and point out issues with the article (typo, wrong info, etc.). If you're seeking help for your game, please ask a question on the forums. Thanks!

58 Comments

Abigayl
lol, tis fine. Glad to help :)
0 14 years, 5 months ago
jonathan3087
Perfect, thanks for the work around Abigayl. And thanks for the response. Sorry for clicking the minus button by one of your comments, I thought it would minimize that section of comments, instead it just said Thanks, so I don't really know what that did.
0 14 years, 5 months ago
Abigayl
*Close the open behaviors that you want to use the new game attribute for and re-open. Any currently closed when the game attribute was made will come up normally (hence why the closing trick works).
1 14 years, 5 months ago
Abigayl
Jonathan, can ignore my previous comment... obviously you found the additional tutorials :P. What you have found is a slight "bug" in the StencylWorks system. When creating a game attribute with behaviors already open, they will not appear in the palette list until either you click on something in the game attributes palette or (more commonly) close the behavior and re-open.
0 14 years, 5 months ago
jonathan3087
Again, a great tutorial, my only issue was trying to add Score and High Score to the behavior for CreatEnemies. Score and High Score were created as Game Attirbutes, and they displayed in purple, but the weren't available for me until I went to the screen where I created them and then right click and choose Add to Favorites.

I am using version 1.3.4(b413), is there something that I probably missed to get the game attributes to show up on the other behavior screens without first adding them to Favorites?

0 14 years, 5 months ago
Abigayl
Glad to hear you got it working. There is much to be learned by debugging your own code (although I am here to help if needed). Good luck with your game :)
0 14 years, 5 months ago
VirusChris
Found the problem after carefully looking at your tutorial. I put it "do AFTER # seconds" snippet instead of the "do EVERY # seconds" snippet which causes the score to remain as 1 constantly.

Fix that problem. There's always something I overlook, but it's good for me to encounter these bugs. Going back to where I messed up and knowing how to fix the problem will help me undo my future mistakes with ease and at a faster pace.

Thanks for helping me again! ^_^

PS: By the way, with what you have setup so far I can manage making a space shooter/bullet hell game like Touhou which would be awesome!

0 14 years, 5 months ago
Abigayl
Chris, make sure you are using "set score to [score 1]". Without saying that it equals the previous amount plus an additional 1 (or whatever number you want to use), the score will not increment. It MUST include the original score, and addition (or other math function), and another number. If any of the three are missing, the code doesn't work.
1 14 years, 5 months ago
VirusChris
Hmm... I got everything right, except for the score adding part. For some reason the score is ALWAYS a 1 no matter how long I last on the level.

I double-checked on the Controls Snippet in the "when created" section with the set Score to "Score 1" after 0.01 seconds. I'm not sure where to look. I'm going to bed right now... I'm tired, but I'll get back to it later.

0 14 years, 5 months ago
Abigayl
Thanks Jack
0 14 years, 5 months ago

Sign In to Comment