Assigning and object a value

For questions about using Classic.

Post » Sun Aug 01, 2010 4:16 pm

I have used create object by name, and in the same event or subevent, i want to give that object some values.

Is it possible and how would i do it?
B
3
G
4
Posts: 54
Reputation: 1,183

Post » Sun Aug 01, 2010 4:22 pm

You just solved your problem right there. Under the "create object" action, make some "set value to _" actions. There are probably other ways but this seems to be working fine for me..doesn't just work with values either.
Image
B
225
S
27
G
13
Posts: 1,774
Reputation: 18,024

Post » Sun Aug 01, 2010 4:31 pm

how do i set value to _???
B
3
G
4
Posts: 54
Reputation: 1,183

Post » Sun Aug 01, 2010 4:33 pm

Set a private variable to your value.
B
1
G
2
Posts: 8
Reputation: 641

Post » Sun Aug 01, 2010 4:50 pm

yeah, but how do i give it to the object if i cannot select the object in the actions by name.
B
3
G
4
Posts: 54
Reputation: 1,183

Post » Sun Aug 01, 2010 4:54 pm

Run Script - ObjectName.VariableName = x should help.
B
1
G
2
Posts: 8
Reputation: 641

Post » Sun Aug 01, 2010 5:05 pm

it doesnt work it says, system is not an object name

Tank.value('nameofthecreated').id = Tank.uid

wait ill make an example...

http://www.mediafire.com/?w2zrig8ycmos5k3

ok here you go... as you can see i cannot set the value properly
B
3
G
4
Posts: 54
Reputation: 1,183

Post » Sun Aug 01, 2010 5:57 pm

The created object Sprite.Value('c1'), not Sprite.Value('create1') (pv does not exist), should be placed into the SOL automatically after its created.
Image Image
B
161
S
48
G
90
Posts: 7,348
Reputation: 66,751

Post » Sun Aug 01, 2010 6:04 pm

I dont understand but it creates the object by the name of the create1 var... the c1 is just so the event doesnt loop. The point is, i want to set the value id to the uid of the sprite to the created object(smiley) ...

I mean is there a way to change the selected object to the one created within the actions, and giving it a value...
B
3
G
4
Posts: 54
Reputation: 1,183

Post » Sun Aug 01, 2010 6:28 pm

Question is why do you need to create the object?
[url:1cmb31kt]http://dl.dropbox.com/u/666516/idtouid.cap[/url:1cmb31kt]
Image Image
B
161
S
48
G
90
Posts: 7,348
Reputation: 66,751

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 0 guests