Need some scripters help...

If you have problems installing or running Algodoo, have found a bug or need in-game help - this is it!

Need some scripters help...

Postby vaidas369 » Mon Oct 23, 2017 9:39 pm

Ok so I attached everything you need to know inside the scene.
But here is a copy:
What I need is simple logic script
Just as clicking on buy/sell apple you choose your basket. When choosing, if you decide to take another one, the one that you have previously had will be returned (visually speaking) and gold for it will be returned. Also, I need that information of what basked I have would be saved into a variable such as a scene.my.basket = 1 for pink, 2 for orange, 3 brown and so on...
Example of works if you have 15 gold:
I press on the orange basket and I lose 8 gold. (Got 7 gold left)
If I would decide to get the brown one, I would get 8 (got 15 of gold) back from orange nad been taken away 6. (9 gold left)
You get the idea. I tried multiple scripts but they all are buggy, with bugs like - keep taking points for the same basket if pressed more then once.
basket value variable does not work
and so on. I know its easy bus as for a guy who does not program and knows only fundamentals of C++ and C# its quite hard haha. Thank you for reading this and putting some time. Thanks!
(And yes this will be featured in scene, that's why I'm asking for it)

If you don't mind, if you solve it just repost same scene or comment script in comments.
Thank You!
Attachments
help __.phz
the help scene.
(55.74 KiB) Downloaded 8 times
vaidas369
 
Posts: 24
Joined: Thu Jan 30, 2014 8:51 pm

Re: Need some scripters help...

Postby Kilinich » Mon Oct 23, 2017 10:46 pm

That could ba done, but with pretty complicated script. You need to lern it...
Dream of Algodoo as game development engine...
User avatar
Kilinich
[Best bug reporter 2010]
 
Posts: 2098
Joined: Mon Aug 31, 2009 8:27 pm
Location: South Russia

Re: Need some scripters help...

Postby vaidas369 » Mon Oct 23, 2017 11:20 pm

Kilinich wrote:That could be done, but with the pretty complicated script. You need to learn it...

You know, I'm good at reading people. And you are 100% sarcastic.
I know C++ and C# are not even that hard but they are kinda fundamentals to programming, you know them and every other language (most I mean) will look and feel similar. We with my friend try to make a game using old source engine which is based purely on C++ or sharp, not quite sure.
If you can tell me, I would have a foundation to look after (see what I did there hehe).
But in all seriousness I need to know, I cant finish my scene :(

All that aside, would you be up for a challenge? Not on coding though, drag race 2.0
I feel like I was not ready to take your ultimate drag machine for real contest. That Mustang was broken not even talking about magic inside an engine that somehow trusts car forward without gears selected just with pure force haha. Braking physics like a boss.
But you know.. also to make this more interesting, we would make much smaller engines, possibly 3 cylinders only too, to see what
we can take out of them. Head to head, like old times (if there were any haha) What do you say? :roll:
vaidas369
 
Posts: 24
Joined: Thu Jan 30, 2014 8:51 pm

Re: Need some scripters help...

Postby vaidas369 » Tue Oct 24, 2017 8:38 pm

No longer need help, here's all I needed
(e)=>{
scene.my.basket == 2 && scene.my.gold >= 6 ? {
scene.my.gold = scene.my.gold + 8
} : {};
scene.my.basket == 3 ? {} : {
scene.my.gold >= 6 ? {
scene.my.gold = scene.my.gold - 6;
scene.my.basket = 3
} : {}
}
}
simmple hey? And I learned a thing haha
But anyways my offer for contest still stands!
vaidas369
 
Posts: 24
Joined: Thu Jan 30, 2014 8:51 pm


Return to Help / Bug reports

Who is online

Users browsing this forum: No registered users and 2 guests

cron