playMaker

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - krmko

Pages: 1 2 3 [4]
46
Playmaker Help / Bulk changing of values of global variables
« on: September 16, 2016, 12:00:15 PM »
Hi guys,

i made a multiple weapon/weapon heating/damage/bullet system for my game and now i have to make a power-up system which will have double fire rate, double damage and no heating pickups.

Now, i arranged my weapon system like this:

Every weapon has its own prefab (5 weapon levels, 5 different fire rates and 5 patterns). Every weapon level has its own bullet prefab. Weapon X level 1 shoots bullets X level 1, fire rate X, pattern X, weapon X level 2 shoots bullets X level 2, fire rate X, pattern X, etc. You get the idea.

Every bullet prefab has its own heat variable which adds up to the main heat counter (weapon shuts down when it overheats) and damage points variable.

Regarding power-ups, i'm having difficulties of making a concept that would be easiest to work and maintain.

For now, the easiest solution for me with so many prefabs and variables is to simply multiply all the global variables (all are integers) when i pickup double damage or double fire rate power-ups and to seat heat variables of bullets to zero when i pickup the no heating pickup, and revert them back after the timer goes off.

Any ideas on how to do this? Is ia possible to change variables by scripting? I'm also open to other ideas on solving the problem if you have them :D

47
Hi guys,

i posted this on unity forums, but i would like to hear your opinion too!

I am implementing the normal/half/double damage mechanics. The way i do it is like this (simplified):

There are two types of weapons:

1. Bullet
2. Energy

Eash type of weapon can be upgraded, so we have something like this:

1. Bullet Level 1 (deals 2 damage)
2. Bullet Level 2 (deals 4 damage)
3. Energy Level 1 (deals 4 damage)
4. Energy Level 2 (deals 8 damage)

There are two types of enemies too:

1. Red enemy - Bullet does normal damage (2 and 4), Energy does half damage (2 and 4)
2. Blue enemy - Bullet does normal damage (2 and 4), Energy does double damage (8 and 16)

Now, when the bullet enters the collider, it is registered by tag (Bullet Level 1, Bullet Level 2, Energy Level 1, Energy Level 2), corresponding to that, damage variable is called and, depending on the enemy type, it is multiplied, divided, or left as it is. This is a fairly simple example, and the total number of combinations is 8. However, when we insert 20 weapons with 4 upgrade levels and 40 types of enemies, things start to look like spaghetti, overly complicated and hard to maintain.

If there would be a possibility to multiple tag the object and to particular number of damage point when a set of tags is recognized it would be much easier, alas, it is not supported (yeah, i know about the stuff on the asset store, but i want to see what other legit way to do this would be. Besides, i think those are useful only for organizing, i wouldn't know how would i compare multiple tags).

The FSM is:

First state:

Collision 2D event/Compare Tag

Second state:

Int Operator with divide or multiply operator depending on type of damage, or only take damage if there are no modifications.

I would like to hear your opinion :)

48
Playmaker Help / Following the camera and moving [SOLVED]
« on: August 17, 2016, 12:21:46 AM »
Hello,

i have a simple FSM for moving the spaceship around (get axis and set velocity2d). I have a moving camera so the ship has to follow the camera and retain its ability to move at the same time. I can't seem to wrap my head around it, either i set the ship to follow the camera, but i can't move it, either i can move the ship but it doesn't follow the camera, please help! It's a classic shmup setup that i can't seem to recreate.

Here's the FSM i'm using


49
Playmaker Help / Making a smooth speedup and slowdown magnet [SOLVED]
« on: August 03, 2016, 12:13:33 AM »
Hello guys,

i am making a small shmup with the ship having a magnet for pulling credits that stay behind destroyed enemies.

The first part was quite easy:

1. I put the Get Distance action and i store the distance from the object that will be attracted to the Player in the Distance variable.
2. In the Conditional Expression, if the Distance variable is under predetermined value, we go to the next state.
3. Move Towards action is targeted towards Player, with the Max Speed set as MaxSpeed variable.
4. In the Fload Add action i set the Float Variable to MaxSpeed, set the desired increment in the Add field, check every frame, and the magnet is working.
5. To stop the magnet from working, i insert Get Distance action and Conditional Expression again to revert to state one when the object gets out of the magnet's "range". Unfortunately, it stops immediately. So i inserted the third state with Ease Float that will revert to the first state on finish event, but i'm not sure how to set it up, i'm using MaxSpeed as From Value, To Value is 0, but it stops immediately also. I also tried to use Get Speed 2D action, store it in Speed variable and put it in From Value, but it's not working. Any ideas?

50
Action Requests / Set Physics Material 2D[SOLVED]
« on: June 28, 2016, 02:51:52 AM »
This action would be nice, as far as i have seen, there's only set material action, nothing for physics.

51
Action Requests / Flip Sprite Renderer[SOLVED]
« on: June 28, 2016, 02:48:36 AM »
Hello,

as some of you have seen on the help forum, i am trying to make a bullet ricochet and i've found a more elegant solution with physics material 2d - bounce. But since the bullet needs to change its direction, i need Flip Sprite Renderer Action, thank you very much ;D

52
Playmaker Help / Reflecting bullet FSM
« on: June 24, 2016, 04:25:18 AM »
Hello all!

I am trying to make a bullet reflect off a collider in 2D game, but i just can't get my head around it. I checked out the breakout sample game, but that's not quite it since it has a fixed reflection angle based on impacting left or right collider of the paddle and the brick, as far as i have seen. There are some pinball playmaker games, but i think there's also no reflection there, just adding force to the ball when hitting the flipper. I googled a lot, and even found some scripts, but nothing does the job unfortunately. I think it can be done fairly simple in Playmaker, but i need some help.

The bullet has a fixed velocity (not force), so upon colliding it only needs to change direction whle keeping the velocity. I am aware i need to use vector3 reflect under the operator advanced action and i've read about the normal of the impact and calculation of the exit angle and thus the rotation that needs to be applied to the bullet but don't quite know how to implement it.

Any help or example is welcome!

53
Hi to all,

i've encountered an issue which i believe is not to be a deliberate behaviour.

I've made a FSM template for moving along SWS waypoints by using SWS_Set Path action and applied it to object1. When i apply the template to object2 and set a different Path Name, object1 is automatically setting it's Path Name to one set to the object2 and vice versa.

Please advise.

Also, if this is not a bug, please send it to the appropriate part of the forum. Thank You.

54
Playmaker Help / Make Sprite Flash When Hit [SOLVED]
« on: March 21, 2016, 07:26:40 AM »
Hello,

i would really like some help. I am making a side scrolling shooter, and i need to make enemy sprites flash when hit (player bullet box collider 2d coliding with enemy box collider 2d). I tried with set color, but that doesn't work.

Any ideas for the FSM?

55
Playmaker Tutorials / Share your complete FSM templates
« on: February 23, 2016, 04:23:17 AM »
Hi guys, i didn't see this on the forum, but i think it's a great idea for users to share their complete machines, which can be very handy for beginners!

2D Movement Template

Attach it to player game object, used for moving in 2D space, left, right, up, down.

Change the multiplier field under Get Axis actions to change the movement speed. Use arrow keys to move.

56
Playmaker Help / Physics 2D Actions package
« on: February 20, 2016, 10:42:41 AM »
Hi guys, is it possible to update PlayMakerUnity2D.unitypackage since "Is Fixed Angle 2d" is no longer functioning?


57
Hello guys,

i'm new to Playmaker, but i really like how it works, it is very simple for people from nonprogramming background to create even very complex FSM's.

However, sometimes i stumble and i need some help from the community :)



On the first picture we have a very simple FSM attached to the Player object. I am using actions from Core Game Kit for pooling objects. In this case, by pressing key, a shot is spawned from the spawner object attached to the player object, and whenever the player moves, the bullet spawner moves with him. I just dragged and dropped the bullet spawner from the scene to the "other object for position" box, and everything works fine.



In the next picture, i am doing something similar for the Enemy object, but something's not working right. I created the Enemy, spawner object for him to shoot from, and simple FSM to spawn bullets every second. Here comes the problem, i can't drag and drop the spawner object from the scene directly into the "other object For Position" box (i get the menu in the picture with options to get or set property), only from the prefab folder, but then the bullets are spawned right in the middle of the screen, not from the spawning object attached to the enemy object.

Here's another picture to better show you what's going on:



Hope you can help me out, i would be more than grateful :)

Pages: 1 2 3 [4]