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 ... 7
1
PlayMaker Help / Get Rotation Problem
« on: January 18, 2020, 02:26:17 PM »
Hi guys,

I'm doing some 3D for the first time, though i'm doing well there's something i can't figure out. I have an object that's not parented to anything and has rotation 0, 0, -15 set via transform in the inspector.

However, when i use Get Rotation to get its rotation i get something like -270, 0, 0. I tried self world, eulers, quaternions, tons of other actions, delaying the start and so on but i still can't get it the way it is displayed.

Any advice?

2
PlayMaker Help / Missing action warning, but action exists (not custom)
« on: January 11, 2020, 10:55:46 AM »
Hi guys,

i've got a report that the action is mission, but that action is definitely present. Any ideas on what i should do?



I removed the action, put the same back in, but i still get the error.

3
Hi all,

time came to optimize my game a bit since instantiate/destroy calls are making a lot of GC calls and it's about time to address that.

I was happy when nested prefabs came, but in the long run, it creates more problems when you intend on pooling stuff (which is neccessary for my game) since only the parent is pooled, all the children belonging to it are instantiated as usual.

I have two issues to address.

Issue #1

Enemies have multiple children which have their exact default local position and their default state (active/not active). So, for the enemy of type Provoker (in the image below) i have the following:

Enemy Name: Provoker

Child 1: Light
Child 2: Light2
Child 3: ProvokerGunpoint
Child 4: JetAnimation
Child 5: EnemyTag

Child 1 Position: x, y, z
Child 2 Position: x, y, z
Child 3 Position: x, y, z
Child 4 Position: x, y, z
Child 5 Position: x, y, z

Child 1 State: Active/Not Active
Child 2 State: Active/Not Active
Child 3 State: Active/Not Active
Child 4 State: Active/Not Active
Child 5 State: Active/Not Active



So when i spawn the enemy named provoker, fsm on it should get it's name and then spawn children with appropriate position and state.

Issue #2

Second issue is similar to first. Squadrons are groups of enemies which i handled relatively easy with nested prefabs, i just dragged and dropped prefabs, saved them under SquadronNameX prefab and that's it. But, unfortunately, these need to be spawned so using nested prefabs is kinda off.



So i meant of collecting all the data i need (which will be a long and tedious process by itself) and then what? I can store them in some data structure, but i don't know what would be the most suitable, internal like arraylist or external in a script.

The way i'm doing things now is horrible since i have few hundred of these with 5-10 enemies in each. First i need to spawn all enemies one by one and assign a variable for them



Then i need to manually set position for each one of them



It's tedious to do and there's A LOT of space for error. The preferred way would be a structure to draw data from, like get name of the squadron > number of enemies, if name of Squadron is NameX, spawn prefabY, assign positionZ, repeat until finished.

What can you recommend? Hash tables, arrays, huge scriptable object, json, xml?  I'm quite confident in scripting lately, for the first time i see this maybe more viable in script then with fsms, bit i'd like to stick to fsms completely if possible.

P.S.

Not to mention that maintaining the other enemy systems with their data (HP, speed, loot and so on) is beginning to feel real tiresome by using local (per fsm) data, i'd like to organize that a bit better too.

There's some assets like bg database and gamedata editor, i guess they're worth checking out...

4
PlayMaker Help / Late binding sprite atlas sprites
« on: December 23, 2019, 03:49:03 AM »
Hello guys,

i started working on a bit of an optimization for my game, so i split my atlas to multiple ones which will be loaded during runtime and not included in build.

I have them loaded using resource.load, but there's something else to be done. This is called Late Binding (https://docs.unity3d.com/Manual/LateBinding.html).

Ok, so i get property from the SpriteAtlas FsmVar (SpriteAtlas.spriteCount) to get the number of sprites.

When i get the number of sprites, i need to create an array of fixed length which will hold all the sprites and fill it with SpriteAtlas.GetSprites (https://docs.unity3d.com/2017.4/Documentation/ScriptReference/U2D.SpriteAtlas.GetSprites.html)

Ok, i made an array variable, as Array Type i set Object, and for Object type i set Sprite.

I made a script with a simple Sprite array and now i have to call the static method UnityEngine.U2D.SpriteAtlas.GetSprites to fill the array. But when i select the Type Array in Call Static Method Action i get:

Error editing field: Parameters
Unknown FsmArray Type: Use ArrayEditorAttribute to specify a VariableType.

Along with this:

Code: [Select]
System.ArrayTypeMismatchException: Unknown FsmArray Type: Use ArrayEditorAttribute to specify a VariableType.
  at HutongGames.PlayMakerEditor.ActionEditor.EditFsmArray (UnityEngine.GUIContent label, System.Object fieldValue, System.Object[] attributes) [0x00071] in C:\Projects\Playmaker_1.9.1\Projects\Playmaker.source.unity\Assets\PlayMaker\Editor\Classes\ActionEditor.cs:2719
  at HutongGames.PlayMakerEditor.ActionEditor.GUIForFieldTypes (System.String labelText, System.Type type, System.Object fieldValue, System.Object[] attributes) [0x004bb] in C:\Projects\Playmaker_1.9.1\Projects\Playmaker.source.unity\Assets\PlayMaker\Editor\Classes\ActionEditor.cs:1073
  at HutongGames.PlayMakerEditor.ActionEditor.EditFsmVar (UnityEngine.GUIContent label, System.Object fieldValue, System.Object[] attributes) [0x001ed] in C:\Projects\Playmaker_1.9.1\Projects\Playmaker.source.unity\Assets\PlayMaker\Editor\Classes\ActionEditor.cs:1761
  at HutongGames.PlayMakerEditor.ActionEditor.GUIForFieldTypes (System.String labelText, System.Type type, System.Object fieldValue, System.Object[] attributes) [0x001a9] in C:\Projects\Playmaker_1.9.1\Projects\Playmaker.source.unity\Assets\PlayMaker\Editor\Classes\ActionEditor.cs:934
  at HutongGames.PlayMakerEditor.ActionEditor.EditArray (UnityEngine.GUIContent label, System.Type elementType, System.Array array, System.Object[] attributes) [0x001c8] in C:\Projects\Playmaker_1.9.1\Projects\Playmaker.source.unity\Assets\PlayMaker\Editor\Classes\ActionEditor.cs:1254
  at HutongGames.PlayMakerEditor.ActionEditor.EditArray (UnityEngine.GUIContent label, System.Type elementType, System.Object fieldValue, System.Object[] attributes) [0x00014] in C:\Projects\Playmaker_1.9.1\Projects\Playmaker.source.unity\Assets\PlayMaker\Editor\Classes\ActionEditor.cs:1159
  at HutongGames.PlayMakerEditor.ActionEditor.GUIForFieldTypes (System.String labelText, System.Type type, System.Object fieldValue, System.Object[] attributes) [0x0049d] in C:\Projects\Playmaker_1.9.1\Projects\Playmaker.source.unity\Assets\PlayMaker\Editor\Classes\ActionEditor.cs:1069
  at HutongGames.PlayMakerEditor.ActionEditor.EditField (System.Object obj, System.Reflection.FieldInfo field, System.String labelText, System.Type fieldType, System.Object fieldValue, System.Object[] attributes) [0x0000c] in C:\Projects\Playmaker_1.9.1\Projects\Playmaker.source.unity\Assets\PlayMaker\Editor\Classes\ActionEditor.cs:582

Any ideas on how should i proceed on this one?

Pictures might be helfpul too.





This is the static method: public int GetSprites(Sprite[] sprites);

5
Hi guys,

i'm using target frame rate action to clamp the frame rate, but there seems to be a lot of overhead every frame. Now i'm not sure how it actually works, does it use the calculated amount of cpu time to actually keep the frame rate in the defined upper limit, or something's just plain wrong. I'm not using Vsync btw, i'm not sure if it's really neccessary, but the action works without it and doesn't push frame rave over defined threshold.

With Target Frame Rate



Without Target Frame Rate



7
I have a script in which i hold some enum values, but when i add some new ones, Enum Value field in the action gets messed up (another value is shown) so have to redo it every time i add some new enums to the script.

8
Hi guys, is this even possible? I need to put the break in the built string so i can display it in multiple lines via textmeshpro.

9
Hi guys,

the title is self explanatory, i'm trying to attach the object at the point of impact with the collider of another object, but whatever setting or combination of settings i use (world position stays, reset local position) child ends up childed at the center of the parent object.

Is it a faulty action or am i missing something?

EDIT: I solved it by geting the position before the impact and seting the world position after the parenting so it looks and works good, but action should definitely be looked into, world position stays doesn't work.

10
Hi all,

i'm trying to find a solution for rotating some missiles towards direction.

After they're being fired they are moved using translate with no set target. I'm not using velocity so i can't get the direction with velocity data (it's 0,0 since i'm translating the missiles), and i don't know how can i get the direction every frame to apply the rotation by using some other method.

All ideas except "move them using velocity" are welcome  ;D

Edit: of course, the child will be rotating so it doesn't affect the movement.

11
Hi guys,

i have an identical FSM in all of my enemy prefabs that adds a number (int) to an arraylist when the enemy enters the screen, and removes an item when the enemy goes out of the screen. It works flawlessly except on one prefab that reports an "Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index" error.

I don't get it, it's a completely same action (array list add) with completely same parameters on all objects.

Any ideas?

12
Hi guys, here's what's going on. I use Get Key Code to String to get keyboard input and store it into string. Works perfect when i store it into local variable, but whenever i try to set it into global variable it does not work.

- I tried saving it to local variable, then to global from that local variable, nothing
- I tried buidling the string from local variable into another local variable and then try setting the global variable, nothing
- Splitting everything into multiple states, nothing

No errors are being reported, it just doesn't work.

Unity 2018.3.7f, Playmaker 1.9.1b4

13
PlayMaker Help / Cycling through resolutions in array list [SOLVED]
« on: February 18, 2019, 12:42:16 AM »
Hi guys,

when i fire up the game, i get the screen height and width and save it into vector3 as a current resolution variable, which is then set as a string that will show up in the video menu when i go into it. Now, i've got a vector3 arraylist of resolutions, how can i iterate through the array by using the current resolution as an index that will be used as a pointer to get next or previous resolution from the array?

14
PlayMaker Help / Create object advanced action issue [SOLVED]
« on: February 09, 2019, 09:25:02 AM »
Whatever i do, objects are being instantiated at z=1 position. Prefabs have z=0, they do not instantiate parented, object that instantiates them is at z=0.

Settings are world position stays = checked, set active = checked. I tried overriding  the position with z=-1, but it still spawns at z=1.

Any ideas?

15
PlayMaker Help / Question about FsmVar
« on: February 04, 2019, 12:11:25 PM »
Hi guys,

I have an issue, but i need to know how some things work to know how to solve it.

I'm using get array list random to get a random GameObject from array list. Now, when  i instantiate that object with Create Object Advanced it's ok, but when i use Core Game Kit and set the GameObject to spawn it spawns the wrong thing.

I suppose FsmVar is changeable variable that sets its type depending on the type of variable in the action by using PlayMakerUtils.ApplyValueToFsmVar, but why doesn't it work in things like Core Game Kit?

I'll dig up the code to the action of CGK to see how it's handled there, but isn't FsmVar automatically converted to GameObject variable in the Get Array List Random action?

Pages: [1] 2 3 ... 7