[PLUGIN] Instance Group

Forum Home Forum Home > Construct 2 Development > Plugins for Construct 2
 Post Reply Post Reply Page  123 5>
Author
10,389 Rep
Post Options Post Options   Quote rexrainbow Quote  Post ReplyReply Direct Link To This Post Topic: [PLUGIN] Instance Group
    Posted: 16 May 2013 at 4:31am
Capx: Pass SOL into function
SOL will be "pick all" when jumped into a "on function", this capx shown how to pass SOL into "on function" using instance group.


More over, instance group could return a SOL after "on function".

Edited by rexrainbow - 16 May 2013 at 4:36am
Back to Top
10,389 Rep
Post Options Post Options   Quote rexrainbow Quote  Post ReplyReply Direct Link To This Post Posted: 05 May 2013 at 7:14am
Update

Update picking function. No new feature added.

Edited by rexrainbow - 05 May 2013 at 7:15am
Back to Top
10,389 Rep
Post Options Post Options   Quote rexrainbow Quote  Post ReplyReply Direct Link To This Post Posted: 19 Apr 2013 at 2:17am
@MelonGuns

The return value of "RandomGen.random" is between 0~1.
So that "int(RandomGen.random)%3+1" will always return 1.
For example,
RandomGen.random = 0.9
int(0.9) -> 0
0%3 -> 0
0+1 -> 1
Back to Top
468 Rep
Post Options Post Options   Quote MelonGuns Quote  Post ReplyReply Direct Link To This Post Posted: 18 Apr 2013 at 10:54am
@rexrainbow

I use this "int(RandomGen.random)%3+1" value to set a variable, but why I always get 1?
And I also set seed with "wallclocktime"
Back to Top
10,389 Rep
Post Options Post Options   Quote rexrainbow Quote  Post ReplyReply Direct Link To This Post Posted: 12 Apr 2013 at 3:28pm
@melonguns
It might help you.
http://www.scirra.com/forum/how-events-work-destroying-sol_topic50822.html
Back to Top
468 Rep
Post Options Post Options   Quote MelonGuns Quote  Post ReplyReply Direct Link To This Post Posted: 12 Apr 2013 at 12:12pm
@rexrainbow

I don't not understand ... Can you give me a screen shortcut?

And I don't know the condition "pick by UID" ,either . Can I give a instance of some Object type a specific UID when I create it?

And I even don't know the difference between action and condition.Can you tell me ?

This is the first time for me to write a project without codes... And I'm just begin to use this game engine, so I've no idea about a lot of things...
Back to Top
10,389 Rep
Post Options Post Options   Quote rexrainbow Quote  Post ReplyReply Direct Link To This Post Posted: 12 Apr 2013 at 11:51am
@MelonGuns

The condition need to assign a "object type", then the plugin will change the SOL of this object type to the popped one. For example,
+ Pop one instance from typeA
- Set typeA.X to 100

Just like "condition:pick by UID".
Back to Top
468 Rep
Post Options Post Options   Quote MelonGuns Quote  Post ReplyReply Direct Link To This Post Posted: 12 Apr 2013 at 11:42am
@rexrainbow

But how can I get the instance poped from the instGroup?
Back to Top
10,389 Rep
Post Options Post Options   Quote rexrainbow Quote  Post ReplyReply Direct Link To This Post Posted: 12 Apr 2013 at 9:54am
@MelonGuns

Reference

add some Object's instances - "Action:Add instances"
pop an item from a instGroup - "Condition:Pop one instance"
Back to Top
468 Rep
Post Options Post Options   Quote MelonGuns Quote  Post ReplyReply Direct Link To This Post Posted: 12 Apr 2013 at 9:48am
@rexrainbow

I'm so sorry to bother you again and again...
If I want to add some Object's instances ,how to do it? And how to give them UID?
And if I pop an item from a instGroup ,how can I get this Instance? Does it exits a method of the property to get Instance's text or something else so that I can print them out ?
Back to Top
 Post Reply Post Reply Page  123 5>

Forum Jump Forum Permissions View Drop Down