Author Topic: Experimental Lab  (Read 5322 times)

0 Members and 1 Guest are viewing this topic.

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1,794
Re: Experimental Lab
« Reply #75 on: May 20, 2012, 02:04:13 PM »
Is there any way to open the console on iPad?


Also, have you tried stuff like removing the globals?  Obviously they won't work on iPad..

Aino

  • Ent
  • ******
  • Thank You
  • -Given: 1
  • -Receive: 21
  • Posts: 1,492
  • They'll eat you next!
  • Eufloria: Yes
Re: Experimental Lab
« Reply #76 on: May 20, 2012, 02:46:56 PM »
Annikk, the LevelLogic stop running if it encounter a problem. It obvious that one of the functions used doesn't exist in the iOS version :)

Tomfloria

  • Shrub
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 232
  • First iOS modder :D
Re: Experimental Lab
« Reply #77 on: May 20, 2012, 02:48:41 PM »
There is a debug option in the support.lua, but when I change it from false to true, nothing happens

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1,794
Re: Experimental Lab
« Reply #78 on: May 20, 2012, 04:16:12 PM »
Annikk, the LevelLogic stop running if it encounter a problem. It obvious that one of the functions used doesn't exist in the iOS version :)

I'm interested in which functions don't work.  I suspect GetAsteroid():MoveBy and MoveTo don't work at the moment.

It's a shame there's no way to open the console.  That would show error messages and helps a lot with debugging.

Tomfloria

  • Shrub
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 232
  • First iOS modder :D
Re: Experimental Lab
« Reply #79 on: May 20, 2012, 04:19:07 PM »
The main file is encrypted, tried getting into it

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1,794
Re: Experimental Lab
« Reply #80 on: May 21, 2012, 10:24:17 AM »
Code: [Select]
function LevelSetup()

a = AddAsteroidWithAttribs(50,50,1,1,1)
a:SetRadius(180)
a.Owner = 1
a:Reveal(1)

a = AddAsteroidWithAttribs(400,400,1,1,1)
a:SetRadius(180)
a.Owner = 2
a:Reveal(1)

end

function LevelLogic()

x = 0
y = 0
scale = 1000
speed = 3

while GameRunning() do

input = GetGameTime() / speed

x = math.cos(input) * scale
y = math.sin(input) * scale

GetAsteroid(0):MoveTo(x,y)

coroutine.yield()
end

end

Try this level?  That's a good test for whether MoveTo works.. :>

If it works, you should be able to find one asteroid in the level that is floating around in circles.

Tomfloria

  • Shrub
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 232
  • First iOS modder :D
Re: Experimental Lab
« Reply #81 on: May 22, 2012, 01:51:51 PM »
I wish it did, but no the asteroid doesn't move :/

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1,794
Re: Experimental Lab
« Reply #82 on: May 22, 2012, 02:54:50 PM »
Bummer.  No gravity on ipad yet then..
Thanks for testing it.

Aino

  • Ent
  • ******
  • Thank You
  • -Given: 1
  • -Receive: 21
  • Posts: 1,492
  • They'll eat you next!
  • Eufloria: Yes
Re: Experimental Lab
« Reply #83 on: May 22, 2012, 03:26:51 PM »
What about using Entity.Position.X/Y and changing them directly? I guess that'll work?

Tomfloria

  • Shrub
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 232
  • First iOS modder :D
Re: Experimental Lab
« Reply #84 on: May 22, 2012, 03:40:54 PM »
Wouldn't that bulk up the code though? If you wanted it smooth?

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1,794
Re: Experimental Lab
« Reply #85 on: May 23, 2012, 09:45:04 AM »
Good point Aino. :>


Code: [Select]
function LevelSetup()

a = AddAsteroidWithAttribs(50,50,1,1,1)
a:SetRadius(180)
a.Owner = 1
a:Reveal(1)

a = AddAsteroidWithAttribs(400,400,1,1,1)
a:SetRadius(180)
a.Owner = 2
a:Reveal(1)

end

function LevelLogic()

x = 0
y = 0
scale = 1000
speed = 3

while GameRunning() do

input = GetGameTime() / speed

x = math.cos(input) * scale
y = math.sin(input) * scale

GetAsteroid(0).position.x = x
GetAsteroid(0).position.y = y

coroutine.yield()
end

end

How about that? :>

Tomfloria

  • Shrub
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 232
  • First iOS modder :D
Re: Experimental Lab
« Reply #86 on: May 23, 2012, 11:23:25 AM »
Nope, doesn't work haha, shows the same thing as last time, Two asteroids XD

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1,794
Re: Experimental Lab
« Reply #87 on: May 23, 2012, 11:45:34 AM »
Yep so asteroid movement does not work on iPad.  Shame, hopefully that will be changed eventually.

Lost Seedling

  • Shrub
  • ***
  • Thank You
  • -Given: 3
  • -Receive: 3
  • Posts: 148
Drag and Drop Concept
« Reply #88 on: December 25, 2012, 09:31:01 PM »
I'm experimenting with an idea for a map, but am unsure if it is worth pursuing due to an early problem. I'd like some input.

I want to enable the player to drag and drop icons onto asteroids to affect the game-play. Unfortunately, I'm having performance issues with the icons failing to follow the cursor efficiently. I'm not sure if the problem is with my computer speed, my mouse, my code, or just a limitation with the game itself.

If anyone is interested, please run the attached sample and try dragging the spheres around and dropping them on the asteroid or anywhere. For me, in order for the icon to track smoothly, I have to move the cursor rather slowly, otherwise it "drops" the sphere, and I'm not sure if this limitation would be satisfactory for actual game-play. Please let me know how it works on your computer and if you think it is too slow or erratic to be practical. Ideally, the icon would follow the cursor regardless of how fast the mouse is moved.

I don't want to waste time on this idea if it isn't practical.

Thanks!

(我希望我能說中國話)

Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 17
  • Posts: 904
  • Eufloria: Yes
Re: Experimental Lab
« Reply #89 on: December 25, 2012, 09:45:47 PM »
I haven't looked at the code, but could you do something like:

OnMouseDown(){
  if (over an icon){
    selected icon = the icon that was clicked
  }
}

OnMouseUp(){
  if (selected icon~=nil){
    if (mousepos over asteroid){
      //do asteroid + icon things
    }
    selected icon = nil
  }
}

while GameRunning() do {
    if(selected icon ~= nil){
      //draw selected icon at mouse position
    }
}