Saturday, April 6, 2013

Sorry For The Long Post - SMDP, Umbra, GenericMenus

Hello everyone!

I have a couple updates on Super Monster Dance Party, Umbra, and that crafting page I was working on.

I'll start off with Super Monster Dance Party. We're inching ever closer to completion. Dave Troyer has been working hard getting the animations for the monsters done. So far he has 4 out of the 5 monsters completed. Here they are:

As you can see the art style is quite a bit different from the one the monsters were originally styled in. Due to animation limitations Dave decided to go with this style for the monsters.

While setting up the animations to play at the right times in the levels I came across a pretty nifty piece of code for Construct2. It's an expression called tokenat(Variable, Index, Deliminator). I'll explain the three parameters in a second.

If you want it to be more dynamic put tokencount(Variable,Deliminator) in random() instead of a number.
Then it will always update if you add new items.

  • Variable: What this does is you declare the names of the strings you want to access in a global variable. In my example  I am putting the names of the animation sets for the confetti, so I have Red:Blue:Green:Yellow as my text variable separated by a : 

  • Index: For the index parameter this is which substring you want to pick. For instance, if I wanted to get the Blue substring I would have to put 1 as the index(It is a base-0 system where the first object is object 0). If I wanted it to pick a random name out of that list I could put int(random(4)) in the Index spot. This will pick a random number from 0-3 which corresponds with how many names I have in the variable. The in() just converts the random number to an integer, so we don't have decimals since that would throw an error.

  • Deliminator: The Deliminator parameter is pretty simple. It is just telling tokenat() what character(s) were used to separate the substrings in the main variable. I chose to use : because it is easy to put in and it looks nice.
This makes it really simple to play a random animation. The way you would have to achieve the same thing would be to have this setup: 

Takes up a lot more events. That's bad if you are using the free version.

Forward unto Umbra! I figured out that changing the loading video is pretty simple. All you have to do is replace this movie with a Bink video with the same name, or change the name one of the default properties(I'm not sure which one).

If you add a different movie don't forget to set in the default ini's

To make a Bink video you need to download Bink video converter from Rad Game Tools, it's free. Then convert your video, there are several tutorials out there that explain how to do it. Beware: it seems to be pretty picky on what videos it can convert. I've had no luck converting any movies, though my roommate has been able to convert a few. It says it prefers uncompressed .avi or QuickTime videos, though I didn't have any luck with any of the 5-6 video formats I tried. 

Also note that just replacing the movie will not get rid of the tips and map name that show up on loading screens. To do this you have to create your own ViewportClient class and stub out the DrawTransition() function, like so:

class UmbraViewportClient extends GameViewportClient; // Don't draw loading hints or "Precaching..." function DrawTransition(Canvas Canvas) { } defaultproperties { }

Then assign your new ViewportClient to be the default in DefaultEngine.ini:

[Engine.Engine] GameViewportClientClassName=UmbraGame.UmbraViewportClient

If anyone knows how to stop the loading map from switching maps right after the next map is finished loading I would love to know. In other words, let the Bink video finish playing before it changes maps.

See my awesome super-quick models?

I made quite a bit of progress on the crafting page since my last post. I started off with making sure the SWF file updated the resource and recipe inventories correctly and only allowed the player to pick up a maximum of 5 resources and 3 recipes. Once I got them to display correctly(that took a lot of frustrating work, trying to igure out how to work with arrays in both AS3 and UnrealScript) I was able to start working on getting the crafting system in working order. Now you are able to place a recipe in the recipe slot, then place the appropriate resource slot. if a resource/recipe is in use by the system it will be grayed out and unclickable. 

Adding the last iron needed

Once you have the recipe and all the ingredients you'll be able to hit "Craft! and create the item. This feature is still in the works, though I have the base code for it already. I'm waiting to implement this until i get a second dedicated inventory screen, that way you'll be able to see what you crafted. I did implement a drop feature which allows you to select a resource/recipe and drop it on the ground. 

I think once I get this done and I'm feeling a bit ambitious I'll shift most of the work over to UnrealScript instead of shared between both, since UnrealScript is quite a bit faster than AS3. I should have been doing that from the start, but for some reason I was duplicating work again. At least it is working so far, that's the main thing right?

Well, that's all I have for now. Till we meet again!

No comments:

Post a Comment