Welcome to the bikiniverse!

So what am I doing wrong then?!? !?!?!

go.property("offsetter", 0)
go.property("scrolling", false)
go.property("camera", vmath.vector3(0, 0, 0))



function update(self, dt)
self.camera = go.get_position("levelselect:/camera") 
	if self.camera.y ~= 0 then
		self.scrolling = true
		self.offsetter = self.camera.y
	elseif self.scrolling == true then
		self.scrolling = false
		go.animate(go.get_id(), self.offsetter, go.PLAYBACK_ONCE_FORWARD, 0, go.EASING_LINEAR, 2, 0)
	end	
	self.selfpos = go.get_position()
	self.selfpos.y = self.selfpos.y + self.offsetter
	go.set_position(self.selfpos)
end

(nb. i know i still have to make it lerping and not just set position, but right now i get a message “doesnt’ have a property called offsetter”)

EDIT: Okay, got it: it is not the GO but the script that has the property, so instead of using “go.get_id()” in the animate part, i should use “#”. What a pain in the ass. I’ve spent hours on this problem. It’s crazy how quickly i forgot everything I learnt just a few months ago.

1 Like

Exactly. It’s the script component that has the property, not the game object. That’s why you have to do go.animate("#sprite", “tint”, …) to animate the tint of a sprite component. It’s the sprite component that has tint property, not the game object.

2 Likes

Thank you for your help @britzl as usual it has proved invaluable.

Thanks also to @Daggett for his palabras de animo.

2 Likes

A question:

i have had to increase my factory buffer to 512. Although i actually use the factories very rarely. Unless the player is shaking the mouse around very fast (very unlikely), there will only be 1 object generated every second at the absolute most. All of the game objects that are created are deleted almost instantly. Is that a problem?

(I just realised as i was writing this that this is the EXACT REASON that particle effects exist… but anyway, humour me. Is what I am doing okay?)

No, it should not be a problem. And if you’re worried about performance then my recommendation is to test on your target platform and check with the profiler. Do you get 60 fps consistently? Are you well within frame budget? What if you disable the feature and check again? Is the difference significant?

@britzl those are all great questions but it was quicker for me to just to change everything to a particle effect, it was a much simpler way of getting what i wanted. Thanks though.

Can anyone tell me the code to simulate a mouse release? I can’t find it anywhere.

Hmm, how do you mean? There is no proper way for you in code to call the on_input() function yourself.

Perhaps you can move your input handling to a separate function that you can call manually as well as from on_input() and in the case of simulating a mouse release you’d build your action table with the released variable set to true.

Yes, I suppose changing the table would be one way of doing that. In the end I just put all my release behaviour in a local function and called that.

Today the thing that is annoying me is the fact that collection proxies automatically updated themselves if you change the name of the collection they used to refer to. So If I have levels called 1.collection, 2.collection, 3.collection and I decided to swap 3 and 1 around, I have to change their names and then change their proxies as well. I do not think it would be exaggeration to say this is the most frustrating thing in all possible universes

1 Like

Designing levels in bikiniverse is the most satisfying thing in the world. I am literally shivering with pleasure.

(also i am using the company’s air conditioning right now and it is heaven on earth).

5 Likes

Hi Everybody!

It’s nice to see the new website looking so great!
I have a quick coding question. I want to animate the position of every object in a table. Each object’s address is stored in the table. So printing v gives you “DEBUG:SCRIPT: url: [default:/instance2#script]”

for k,v in pairs(self.objects) do 
		--msg.post(v, "ender")
		print(v)
		local pos= go.get_position(v)
		pos.y = pos.y-750
		go.animate(v, "position", go.PLAYBACK_ONCE_FORWARD, pos, go.EASING_OUTBACK, 5, 0)
		go.animate(v, "scale", go.PLAYBACK_ONCE_FORWARD, 0.8, go.EASING_OUTBACK, 1, 0)
		end

this code gives me an error because v refers to its URL rather than the object itself (…right?). So, my question is, how do i correctly use go.get_position() and go.animate() to move an object only using that object’s URL from the table?

2 Likes

Hmm, I would have guessed that it should work. Are you sure it’s not working? What’s the error you’re getting?

V refers to the address of the SCRIPT rather than the object, scripts do not have a position!

You can do msg.url(v.socket, v.path, nil) to get the url of the parent game object.

1 Like

Thanks ross.grams you powerful devil.

Next question: How do I make a particle modifier that pushes particles out from one point? basically this effect: https://www.youtube.com/watch?v=9q8q0psNtZA

I suspect what I want is a cone (3D cone) set at 90 degrees (i.e, an emitter firing particles straight into the camera). However, when I do that, the sprites become invisible because they are also being rotated 90 degrees. Any ideas?

edit: I did it with four 2D cones, which is less satisfying, but works equally well.

You should be able to do it with just one circle emitter and increase scale over time with a curve.

I am still on editor 1. Maybe it’s time i upgraded

1 Like

Hi Everybody!

2018 is going to tbe the year of the bikiniverse! In 2017 I have been recording a solo album (another dream I wanted to accomplish before turning 30). And 2018 I’m going to finish and publish bikiniverse. My to do list is as follows:

1- introduce a narrative element by having a character who explains something to you at the start of (every? most?) levels. I just realised that character could be their own collection and I would barely have to modify each level. That feels fantastic. I have also programmed some cut scenes

2- create some sort of finale for the player reaches the end, and another one for when they collect all the donuts

3- add more music!

p.d if you want to hear my new song it’s here

6 Likes