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
Playmaker Help / Compare variable range
« on: May 13, 2017, 02:29:39 PM »

i'm making a wave spawn system that should operate the following way:

1.) First spawned wave is by default a small wave category
2.) Spawned ships are added to the array
3.) After a predetermined amount of time, an action gets the number of array items (destroyed and ship that left the screen are removed from the array)
4.) It the number of array items left is 0-5, big wave category is spawned, if the number is 5-10, medium wave category is spawned, if the number 11+, small wave category is spawned.

Using the int switch is a bad idea due to a large number of array items, and conditional expression should have two states (check if it's over 5, if it's false, check if it's over 10). Doesn't sound like much, but this is a simplified example, it will have probably much more to compare.

Any ideas on how i could handle it in one state? Maybe some custom int range switch action?

Hi guys,

i'm using UnibulletHell (!/content/19088) for managing shooting in my little game. The maker of the asset, Hironari, was nice enough to put the Callback Events they can be used to trigger whatever you want when the shot is fired on my request.

I have the need for it to trigger the firing animation on the ship, but i'm not sure how to set it up.

I tried something like this, but it doesn't start the event. I also tried marking it as global but nothing, the event doesn't trigger.

Here's what i've got to select

As far as i can see in the code, it launches a unity event, should i put some sort of listener in the FSM or what? Event Proxy?

Edit: i also tried setstate but it also doesn't seem to work.

I also get his when i select BroadcastEvent

Hello, i've got a strange problem. I've got a weapon upgrade system, here's a shot of it

It's simple, weapons on ship are stored in an array as game objects. When you pick up a weapon, it is checked if any of the levels of the same type of weapon exist in the array. If they do, it is upgraded to the next level. If not, empty weapon slot is filled with the pickup weapon, or if all slots are taken, active weapon is replaced with the pickup.

As you see on the following picture, the weapon type that it is checked for is there, but the state does not go to upgrade, but keeps checking for the next levels, like the variable does not match.

I thought there could be a problem because it is a clone (spawned from pool), but it works perfectly fine when it checks for empty weapon object at the end of the compare loop, which is also a cloned item and the names don't match.

Any ideas?

Btw, here's the shot of the populated array:

Only thing that seems quirky to me is that the array is populated with CLONE 1, and in the array contains action it says CLONE 2.

Things work when i use game object compare, but i don't want it to work that way.

Edit: All good, stupid mistake.


i need to change the alpha of an image that's on the object childed under canvas. It contains rect transform, canvas renderer and Image (UnityEngine.UI.Image) itself.

I tried the following:

Getting the color and storing it under global color variable and changing it on runtime - it doesn't work.
Getting the color and storing it under global float variable and changing it - it doesn't work.

Source image is populated on runtime, of course.

It just doesn't get affected, any ideas?

Playmaker Help / Unity hangs when i enter FSM on runtime [SOLVED]
« on: February 24, 2017, 03:11:43 PM »
This started happening all of a sudden, everything works fine before i hit play, but when i try to enter any FSM on runtime, unity freezes and i have to kill it, so i can't get any crash report.

Unity is 5.5.0f, playmaker latest, any ideas?

Playmaker Help / How to resize game view state labels?
« on: February 24, 2017, 11:58:10 AM »

silly question, but i can't find it in the manual, forum, or anywhere in unity. My game view state labels are to small, any way to resize them?

Action Requests / Using Array list get to store item in multiple variables
« on: February 23, 2017, 03:23:24 AM »
Hello, i was wondering if there was a chance to make an Array List Get action that would allow the item that has been gotten to be stored in multiple variables. More than once i had the need to store the array item as a game object and string for example, and using the action twice really seem unnecessary.

An option to select how many variables would you like to fill would be also cool.

I made a mockup:

I think that would be very useful for many users.

Playmaker Help / Restarting a FSM from another object [SOLVED]
« on: February 19, 2017, 04:19:16 PM »
Hi guys, this is some simple stuff, but i'm not sure what should i use. I have a weapon object which detects whether is it equipped on ship or a pickup drifting in space and based on that the state machine branches further. However, when it is replaced by another weapon, it needs to get back to start state so it can do the weapon/pickup check again.

I can't use reset on exit since i will be activating it from another object. I tried sending an event but it didn't work out, i don't know if i'm doing it right.

The event is global of course.

I tried some debugging, but obviously event has not been received.

Any ideas?

Playmaker Help / Simple problem to be solved with Arraymaker
« on: February 07, 2017, 01:26:11 PM »

I must admit that i've been running away from arrays for some time, but there comes a time when you simply can't do your thing without them. It came for me and i need your help to finally overcome one of the last obstacles in, well, some basic Playmaker functions (after that it's time for enums ;D).

As i said, it is simple but includes using arrays (i have been using them for some VERY basic stuff, nothing more).

Here's a simplified example:

- There are three weapons in the game, let's call them Sword, Axe and Spear.

- Every weapon has three upgrade levels which are basically separate objects. So we have Sword1, Sword2, Sword3, Axe1, Axe2, Axe3, Spear1, Spear2, Spear3.

- Player can only hold two weapons, and use one weapon at a time (let's call it currently active weapon).

- When player holds Sword and Axe and pickups Spear, currently used weapon is replaced by Spear.

- When player holds Sword1 and Axe1 and pickups Sword1, Sword1 is upgraded to Sword2.

How i think it should be done:

I have weapon objects themselves. They spawn on the player and do their thing (fire, deal damage...).

I have pickup objects which are basically empty objects with sprite renderer and collider.

Case 1:

Player is equipped with Axe1 and Sword1, they are added to the Weapons Equipped array - that's simple and i know how to do it.

Player stops on Sword1 pickup and clicks the button to pick it up.

Weapons Equipped array is be checked if it contains Sword1, Sword2 or Sword3. If it contains any of those three, Sword1 weapon object will be destroyed, removed from Weapons Equipped array, Sword2 weapon object will be created on player and added to Weapons Equipped array.

Pickup object will be destroyed.

Case 2:

Player is equipped with Axe1 and Sword1, they are added to the Weapons Equipped array.

Player stops on Spear1 pickup and clicks the button to pick it up.

Array is checked if it contains Spear1, Spear2 or Spear3. There are no such objects in the array, so the currently active weapon object (Sword1 or Axe1) is removed from array and destroyed. Spear1 weapon object will be created on player and added to Weapons Equipped array.

Pickup object will be destroyed.

I tried using the Arraymaker, and i suppose i should use Array Get Next to loop through all the array items, but i don't know how to use it. Ok, i can set it to loop through all of them, and then what? How do i compare the pickup object with all the array items? What does the result represent?

Ok, so there's Array Contains action, but the only way i can think of using it is like this:

- I pick up Sword1 pickup object
- I run Array Contains action and check if the array contains Sword1. If it doesn't the next state which checks is the array contains Sword2 is called, and so on.

Of course, the game is a bit more complicated than the example so it would take a few more events (which means more frames) to check for all weapon objects so i think this is not the right approach and can be done a lot simpler. I watched the Arraymaker GetNext tutorial by RezRezRez, but i don't quite get it, i'm more of a reading than watching guy.

Playmaker Help / Line Renderer Glitch
« on: February 06, 2017, 11:31:36 AM »
Hello guys,

it took me some time to make a functioning line renderer continuous laser beam in a 2D sidescrolling game, but there it is. Unfortunately, a glitch occurs.

Here's how it's setup:

First step is getting the original line renderer X position for later reference.

Standby state, waiting for player to fire the laser beam.

Raycasting with line cast. Hit location is stored to be used for positioning end object for line renderer. Bool test is used to determine if object is hit or not.

Nothing hit, line renders from ship to original end point, everything fine.

We hit something! Magic happens, hit location is converted from vector2 to vector3, line renderer end point is set to hit location, line is drawn, then to loop gets back to raycasting again.

Everything works fine, but two bad things happen.

As you can see, the first thing is that the laser sometimes gets through the object.

Second thing is this:

I separated line casting and the draw line events in different states so the line wouldn't be drawn until the hit position is taken and line renderer end object set on hit position, but it occurs if the first shot did not hit anything. Do you think that i should perhaps put setting the position of line renderer end object in a separate state before firing or maybe use a raycast? Set Position in a different state would cause one frame of lag tho.

Please help, i'm going out of my mind >:(

Playmaker Help / Detaching children on collision [SOLVED]
« on: January 28, 2017, 07:11:29 AM »

i'm using Core Gamekit together with playmaker for my game. I made some missiles that have a child particle system for trail generation from a spritesheet. As you know, when the particle system object is destroyed, particles don't finish their lifetime and die, but die instantly. That poses a problem since when the missile hits the target and explodes all the particles disappear at the same moment too.

I tried putting the particle system on a child prefab and detaching it upon impact, but it seems that the despawn of the missile and the detachment happen in the same update period, so it doesn't work properly. Any elegant ideas on how to solve this, i.e. make the particle system object detach properly? Listening to the missile hp doesn't work, and getting the distance is also useless since missile hits the collider which is way off from the object center.

Playmaker Help / 2 questions regarding facing direction in 2D [SOLVED]
« on: January 10, 2017, 05:06:19 AM »
1. I've got some paths that i'm using in Simple Waypoint System in 2D, and this is what i'm basically trying to do.

Ship in the upper part of the waypoint moves as set in transform, but i want it to flip sprite or change it's Y rotation when it starts moving right, like the one down. It uses Catmull Rom without locked positions, so it always faces forward. Changing the transform or flipping a sprite is not a problem, but i don't know what parameter should i listen as a condition.

I'm pretty bad with quaternions, vectors and other rotation related stuff, so i'd really appreciate some help, i'm sure it's simple :)

2. I've got a type of enemy that measures distance from the player, once it is in range, it gets player position in that moment (let's name it PlayerPosition), and speeds up towards PlayerPosition with Move Towards. However, i don't want the enemy to stop when it reaches PlayerLocation, i want him to continue moving until it gets off screen. That's the first part of the problem, how to get the direction of movement and continue moving along it. The second is that i want the enemy to rotate towards the PlayerPosition.

As i said, i'm not really proficient with rotations, i've been checking out unity forums, and i see that some of the solutions include quaternion lerping/slerping, but i'm not sure how it is used. I tried using vector3 rotate towards, but to no avail.

Playmaker Help / Translate Movement unexpected behaviour [SOLVED]
« on: January 08, 2017, 08:56:14 AM »

i'm using a quite simple FSM for translating the object depending on its position. I get the objects position, and i compare it to float values, which are thresholds that determine the movement direction.

As you can see, there are four possible outcomes:

1. If the object is instantiated on the upper portion of the screen, it translates down
2. If the object is instantiated on the lower portion of the screen, it translates up
3. If the object is instantiated on the left portion of the screen, it translates right
4. If the object is instantiated on the right portion of the screen, it translates left

3 and 4 work great, but when it instantiates up or down, the Y axis movement is ok, but it also applies the same amount of translation to the negative X axis, so the object move down/left when it is instantiated in the upper part of the screen, and up/left when it's instantiated in the lower part of the screen.

Any ideas what's going on? No translation is being set until the final states.

Playmaker Help / Get Position / Set Position problem
« on: January 03, 2017, 02:35:55 AM »
Hi guys,

i have a small spawner which is supposed to spawn gameobjects in a a pattern (spaceships spawning in arrow formation). Spawner is an empty object with an FSM which contains one state and the following actions:

Get Position - Getting the position in World space and storing it as Vector3 variable Spawner Position.

Spawning a GameObject - I'm using Core GameKit for spawning. Spawn Position Mode is set to Use This Object Position to Spawn on the place of the Spawner, and i store the Spawned Game Object as GameObject variable.

Set Position of a GameObject - For the GameObject whose position i want to set i choose stored GameObject variable, select Spawner Position for the Vector3, and adjust X, Y and Z position relative to Self Space.

But, the object sets it position relative to world space and it appears near the world center.

Any ideas what i'm doing wrong? I had a similar setup with with two different objects (Spaceship and a GunPoint spawning on a defined space on the spaceship) and things worked fine. Spaceship had the Get Position on itself, and it stored the position in vector3 variable in world space. The GunPoint had Set Position, used the Spaceship vector3, and Space set to Self and it worked, i don't know what's different here.

Action Requests / Check for visible objects with TAG[SOLVED]
« on: December 30, 2016, 02:37:02 AM »
Hi guys,

is is possible to make an action that would check if any objects with TAG are visible or not and then move to the following action if TRUE or no if FALSE?

I am using Core GameKit and i want to fire custom events based on the info is any enemies are visible on the screen or not.

Pages: 1 2 [3] 4