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 - Gevarre

Pages: [1] 2
PlayMaker Help / Array List Get Next not resetting?
« on: May 12, 2014, 01:57:04 PM »
I'm using an ArrayListGetNext action to loop through some things in an array and then using the Finished event to do something else.

This is all working fine, but the trouble is that if I go back to that same action later and use that same ArrayListGetNext again, the second time it just goes straight to the Finished event instead of starting at the beginning again. it's like it's not resetting to the beginning of the list or something, but instead just leaving the pointer at the end where it left off previously.

Is anyone else having this problem, or do I need to do something different?

PlayMaker Help / GUI Label freezing FSM progression?
« on: June 25, 2013, 02:31:19 PM »
I may be using this wrong, but since there is very little documentation on this playmaker action, I'll ask about it here.

I've got an FSM set up where I have a GUI Label action set to print my current health to the screen. I would expect the action to create the label with the appropriate text and so on, and then move on to the next action.

The trouble is, it seems to be creating the label, and then it just sits in that action. The checkbox for it at runtime is green, but any actions that follow it are never called and using a "Finished" transition after it never happens. If I uncheck the checkbox next to that action, then everything else works perfectly.

Anyone else seeing this?

Action Requests / PhotonNetwork.Destroy()?
« on: June 21, 2013, 08:33:02 PM »
There doesn't currently seem to be any way to network destroy objects in the photon list, unless I'm missing something.

Action Requests / Physics.IgnoreCollision
« on: June 15, 2013, 01:41:14 PM »
In Unity scripting, when the player instantiates a projectile, I use Physics.IgnoreCollision to get the projectile to ignore the player. I don't see any equivalent in Playmaker.

Here is the full script from the scripting docs:
Code: [Select]
// Instantiate a bullet and make it ignore collisions with this object.
    var bulletPrefab : Transform;
    function Start () {
        var bullet = Instantiate(bulletPrefab) as Transform;
        Physics.IgnoreCollision(bullet.collider, collider);

Any chance we can get an action made for this? It's kind of tricky to do it mixing Playmaker and scripting in this case because it needs to be called immediately after instantiation.


PlayMaker Help / How do I send data between networked players?
« on: June 14, 2013, 07:16:57 PM »
I'm still trying to get my in-game networked scoreboard working and am having a bit of trouble getting data between players.

What I've got is a Scoreboard Manager FSM in the scene with an ArrayMaker hash table attached. As each player connects, the manager reads the player's name from the preferences file and stores it in a global variable. I now need to transmit that variable to all players and then tell their manager to append their individual hashtables and refresh the scoreboard.

What I'm having problems with is how to send that player name variable to the other players. I've got a SendRemoteEvent on the scoreboard manager that triggers the event on all other players' managers, but when I set "String Data" within that SendRemoteEvent to the variable I want to send, I get the following error:

Sending RPC 'SendRemoteFsmEvent' failed because the number of supplied parameters doesn't match the rpc declaration. Expected 1 but got 2 parameters.

I have no idea what this error means and I'm probably going about this entirely the wrong way, so any help would be appreciated.

The documentation doesn't really go into what to do with that String Data field other than to say "Use GetEventInfo to read the data", but I have no clue as to how to set that up. In Unity scripting, I would just send an RPC with the data, then the receiving RPC function would just automatically assign that incoming data to whatever variable I wanted and go from there, but I don't know what the equivalent would be in Playmaker.

Anyone have any luck getting a text string into an NGui label with line feeds?

By that I mean, I'm trying to make an in-game scoreboard. I get the players' names from an array and put them all together with "\n" between each one, so it ends up like this:

Player 1 \n Player 2 \n Player 3

Then I send it to NGui using a SetProperty action linked to the text field of the label. The text gets there all right. it's just that it prints it all on one line.

I'm using "\n" because that's what their docs say the label recognizes, but evidently only "through code" and not just as a text string. I got that explanation from a thread I started there, but so far no explanation as to what to actually do.

Just wondering if anyone has tried to do this. As I say, it's for a scoreboard, so it'll display things like health, kills, etc. If there's a better way to do this (With Ngui), I'd be grateful for any help or guidance.

I'm not sure if I'm somehow using this wrong or if it's a bug with either Playmaker or Unity, so here goes:

If I have a prefab with an FSM that contains the CollisionEvent action, it works fine on detecting collisions on other prefabs that have only one collider, but if there's another collider anywhere in the hierarchy, whether that second collider can be touched or not, the CollisionEvent completely stops working.

For example:
I created a prefab that was just a cube with a collider and rigid body (This was my "target") and placed it in a scene. I've got a projectile that is just a sphere, again with a collider and rigid body. The projectile is identified with the tag "Bullet". The target has an FSM with the CollisionEvent action in the start state set up with the default "On Collision Enter", "Collide Tag" set to Bullet, and "Store Collider" set to a GameObject variable.

If I shoot the projectile at the target, it works perfectly: The Bullet tag is detected, the Projectile name is stored in the variable, and the Send Event is triggered.

If I now add a child game object to the projectile and put a collider on it, any size, any kind, and even reduce it's size to almost zero so there's no way it can be hitting anything because of the much larger Main collision, the CollisionEvent on the target stops working entirely: the event doesn't fire and nothing shows up in the Store Collider debug field. All objects are left on the "default" layer, so no funny business there.

What makes me think this is some kind of issue with Playmaker, is that if I put the following javascript on the target:

Code: [Select]
function OnCollisionEnter (hit:Collision)
Debug.Log ("Puck hit: " + hit.gameObject.tag);

I get a debug that works every time. The collision is always detected and the right tag returned. It doesn't matter how many colliders on children I have, it just works.

What makes it even more interesting is that if, on the target, I get rid of the CollisionEvent and instead make a new state, right-click on it, and choose "Add Global Transition > System Events > Collision Enter", and then add a GetCollisionInfo action, I can use the "GameObjectHit" option to return the name of the object and then use GameObjectCompareTag to trigger the event I want. This method works just fine, but isn't possible to use in a lot of situations.

Any thoughts?

When using straight Unity scripting, the default function is "function OnCollisionEnter (hit:Collision)". There is no need to compare to a tag and by default it will return the collider of anything it hits.

With the CollisionEvent action, you are forced to choose either:
Untagged, which only fires on objects with no tag at all on them.
A specific tag: meaning it will only check for objects with one single specific tag.
Or "none", which doesn't seem to check anything at all and never fires.

By default this action should always return a collider and fire off the send event and only get more specific if the scripter changes the default setup. Either the behavior of "none" needs to be changed to mean "don't check for a specific collider, just always return whatever is hit" or there needs to be an additional tag labeled "All" that checks for all collisions, tagged or not.

The current way "none" is set up makes no sense: if the action will never fire, then what's the point of it being there? If "none" is just a standard field that's on all actions that can't be changed, then an "All" option would be the better default choice, since it's most self-explanatory and most mimics default Unity scripting.

I thought I was going nuts or had screwed something up when I figured out my projectiles had all suddenly stopped working, then I realized I had recently converted them from straight scripting to Playmaker and hadn't really tested much.

Note: MaDDoX make an updated version of this action way back in 2011 which adds the ability to check for multiple tags. I'm surprised this hasn't been integrated into the mainline yet. It still doesn't, however, address the need for a check for "All" colliders.

i'm trying create an in-game scoreboard in a multiplayer game. I have a game manager object in the scene with an arrayMaker hash table.

As each player is instantiated into the game, they read their playerName from their player pref and send as both key and value (this'll change later to store other values).

So far, so good. I have a hash table with all the names. Trouble is, now I need to step through those keys and put those values into the scoreboard (In this case Ngui labels). I can find individual keys by their text string, but what I need is a way to get item 1 and set it, get item 2 and set it, etc.

Is there any way to do this without knowing the key strings? This probably isn't even the best way to do this, but I've looked around and haven't found any good examples of this for a networked game, so I'm trying to do it from scratch. any links to examples would also be greatly appreciated.


I'm trying to make a basic NGui input field to store the player's name in playerprefs.

I've made an NGui input object and attached the NGuiEventsToPlaymakerFsmEvents script to it and edited it to add a function to fire an event when the text is submitted (found the code in the "NGUI Integration (WIP)" thread.

I've set up an FSM on the object and gotten the event to fire just fine when the text is entered. I just have no clue as to how to get at/read that string when it happens. The closest I've gotten is that there seems to be a string variable in the UIInput.cs script named "text", but I have no idea how to access it.

Anyone know how to do this?

Sorry for all the questions, but this really is a different way of working for me and I'm still getting used to it.

In my scene, I've got a pickup manager that's spawning a pickup with network instatiate and sending it an integer value. The pickup is then supposed to read that integer value and activate various components accordingly. The trouble is that it always ends up being false no matter what I do. I'm guessing I'm doing something wrong since I've tried this with Integers, strings, and game objects and it always is the same. I'm not using any global variables on this, if that makes any difference.

The first image, labeled "SetInt", is the pickup manager. It is generating the number 5 and storing it in the variable "testActivated". It is then network Instantiating the prefab "Pickup" and saving it in the variable "spawnedPickup". After that it uses Set FSM Int to set the variable "testActivated" on spawnedPickup. So far, so good. You can see all the values there.

The second image, labeled "IntCompare", is the pickup. It just uses Int Compare to read the variable "testInt" (which is on the pickup). You can see that it reads the value of "5", but when it compares it to "integer 2", which is set to "1", it returns that it is Less Than, which obviously it isn't.

I'm guessing it's not actually seeing that "5" as an integer, but I have no idea how to fix it.

Any ideas?

I think this is more a problem with my logic than anything else, so I'm looking for thoughts or tips here.

I've got a networked game going (again, this is not using Photon). In the main scene I have an object with an FSM to spawn a bunch of pickups randomly at various spawnpoints.

The way the manager is set up, after the scene loads, it does a "IsServer" test. If it's true, then it runs the spawn actions. If false, it ends. All good so far. Everyone can see the pickups.

The trouble is, since the manager is a scene element, for each subsequent player that joins and loads that scene, the "IsServer" test is run on each computer, and the one that is the server then goes through the whole process again, so you end up with multiple copies of the pickup at each place, one for each player that's joined.

I'm hoping this is just a problem with my sequence of events, but I won't be surprised if I have to do something completely different. I've seen a thread on here about Pool Manager, but I have no idea if it is network-capable. It looks like a good solution if it is.

Has anyone else done this that wouldn't mind sharing how or that could at least point me in the right direction?

PlayMaker Help / Is SendRemoteEvent actually working? [Solved]
« on: May 18, 2013, 07:47:34 PM »
I ask this question because I can't seem to make it work and I can't find any examples of this in use anywhere, so I have nothing to go by.

I've created a simple FSM that's set up so that when the right mouse button is clicked, it goes to a second state that contains the SendRemoteEvent action. So far this works when testing.

I then have another state that has a global transition going into it. (I attach this by right-clicking on the state and selecting "Add global transition>Global Events>myGlobalEvent)

The "Remote Event" field is then set to the global event, "Game Object" is left on the default "Use Owner", and "Mode" is set to default "All". Additionally, a network View has been attached to the object containing the FSM and is set to observe the FSM.

When played, the FSM proceeds normally to the state containing the SendRemoteEvent, but the global event it's set to never gets triggered.

I've checked the SendRemoveEvent.cs script and I see it's using a standard networkView.RPC call, so all I can think of is that whatever is done when you click the "Global flag" on the event isn't setting up the event as a proper RPC or something along those lines, though I can't seem to find where the actual FSMs are stored to check that. (I'm guessing they are actually encoded into the main Playmaker framework and are not accessible?)

Anyway, I've found the networking examples on the website here, but all they do is go through the very basic steps of connecting players. There's nothing in them at all about sending messages. Is there any example anywhere of this being set up for a networked game and properly working? This is something that is really, really needed.

Thanks in advance as always for all the help.

PlayMaker Help / How do I use Send Remote Event?
« on: May 13, 2013, 10:27:45 PM »
I'm trying to set up a pickup in a networked game and am having a little problem with Send Remote Event. What should happen is when the player enters the trigger on the pickup, the pickup should send the remote event to the player.

The player has an fsm with the event I want to activate in it. The event is set to global. On the pickup I have a state that stores the game object of the player in it when it's triggered. After that I have the Send Remote Event. I use "Specify Game Object" and set it to the stored variable of the player, but when I go to select the "Remote Event", all I can select from are the events on the pickup. The global event on the player isn't listed at all.

I'm probably just setting it up wrong, but there doesn't seem to be any example of this anywhere to look at. Any clues would be appreciated.

Thanks :)

I just found what I'm not sure is a bug or just something I'm doing wrong. I'm doing a networked game and I find that if I Network Instantiate something (for instance: a particle effect prefab with a network view) and then kill it using Network Destroy, all Network Instantiated objects in my scene are killed, including the player!

All prefabs have a network view, all view IDs at runtime are unique, nothing is parented to anything else, so I don't see any chain of events that would cause them all to die unless there is some kind of bug or some kind of setting I don't know about. This is my third networked game using Unity, so I'm pretty sure it's not something Unity-wise. Also note: I'm using straight-up Unity networking, not PUN, so that shouldn't be the issue.

Anyone else run into an issue with this? I found one forum post from 2012 mentioning that there was a bug with the Network Destroy action and that it was being fixed. Did this change ever make it into release?

Pages: [1] 2