Devs want cricket? Then first fix the basketball

(previously 'DEVELOPER') Private forum for registered community members. To register, please visit www.prison-architect.com/register.

Moderator: NBJeff

murgh
level2
level2
Posts: 232
Joined: Sat Jan 30, 2016 11:52 am

Devs want cricket? Then first fix the basketball

Postby murgh » Wed Jul 27, 2016 6:14 pm

Lol this preview update 8a completely messed up my basketball mod. I have no idea what you guys have done but the ball just goes nuts and so does the trainer when trying to find it after it's gone.
Cool to show the mod in the video, but not cool it's broken as hell and I have no idea where to start searching for the problem...
Any hints on what has exactly changed in the modding system? More elaborate info than the little change notes is needed!
murgh
level2
level2
Posts: 232
Joined: Sat Jan 30, 2016 11:52 am

Re: Devs want cricket? Then first fix the basketball

Postby murgh » Wed Jul 27, 2016 9:36 pm

Hmm, never mind, I found the bug... So you've change something with Vel.x or ApplyVelocity? That sort of stuff? Would be nice to know exactly how that works.
Trixi
level2
level2
Posts: 245
Joined: Wed Mar 04, 2015 9:22 am
Location: Ulm, Germany
Contact:

Re: Devs want cricket? Then first fix the basketball

Postby Trixi » Sat Jul 30, 2016 10:32 am

they always break the mod, when they mention one xd
murgh
level2
level2
Posts: 232
Joined: Sat Jan 30, 2016 11:52 am

Re: Devs want cricket? Then first fix the basketball

Postby murgh » Sat Jul 30, 2016 9:51 pm

Trixi wrote:they always break the mod, when they mention one xd


Well this time it's the other way around... This piece leftover of testcode in the balls' script

Code: Select all

   this.Vel.x=this.Vel.x*10 -- seems to have no effect? or does it?
   this.Vel.y=this.Vel.y*10 -- ^^
apparently never did anything up to version 8a, because suddenly the ball got a LOT of velocity. Commenting the lines out made the ball behave like it should, instead of making it move 10 times faster.
elDiablo
level5
level5
Posts: 3111
Joined: Thu Mar 14, 2002 12:23 pm
Location: London, UK

Re: Devs want cricket? Then first fix the basketball

Postby elDiablo » Mon Aug 01, 2016 10:02 am

Hey murgh, I tried to email you via the forums, but guess it didn't work. There was a mantis bug that was incorrectly casting some types of variables (assuming a bool when it was a string - oops!), which might have affected this. Glad you found the problem and it wasn't something nasty that needed a hotfix.
murgh
level2
level2
Posts: 232
Joined: Sat Jan 30, 2016 11:52 am

Re: Devs want cricket? Then first fix the basketball

Postby murgh » Mon Aug 01, 2016 1:52 pm

elDiablo wrote:Hey murgh, I tried to email you via the forums, but guess it didn't work. There was a mantis bug that was incorrectly casting some types of variables (assuming a bool when it was a string - oops!), which might have affected this. Glad you found the problem and it wasn't something nasty that needed a hotfix.



I don't check that address too often, but I see now that you've mailed me indeed. :)

The only thing I had to change was commenting a few lines in the basketball.lua script. After that it worked fine again:

Code: Select all

...
      timeTot=0
      timePerUpdate=0
      if this.Carried==0 and this.Loaded==false and this.NewPosX~=nil then
         --this.Vel.x=this.Vel.x*10 -- seems to have no effect? or does it?
         --this.Vel.y=this.Vel.y*10 -- ^^
         --this.AnimateVelocity=true -- ^^
         --this.ApplyVelocity(this.Vel.x, this.Vel.y, false) -- ^^
         this.NavigateTo(this.NewPosX,this.NewPosY)
         --this.AnimateVelocity=true
...


So my guess was something changed to Vel.x/y (since making the velocity 10 times faster apparently didn't work prior to PA8a). It's the only thing I can imagine making the ball shoot like a jet fighter to its next target. Unless it has to do with AnimateVelocity or ApplyVelocity, since I just commented everything out.

BTW I do hope that the new interface for objects is still a preview and not considered a finished item on the to do list.
Buttons behave very inconveniently now, it used to be much better. Basically every mod using buttons has now a disadvantage. Please read more here http://bugs.introversion.co.uk/view.php?id=11068

Also the debug window seems to open a random screen instead of the window for that item you clicked on. Whenever there is an error now, it will open a debug window but show nothing. You'll have to manually find the object with the error from the new pulldown menu, and then I get a heart attack because half of my screen is suddenly filled with numbers to choose from. Many scripted items in a big prison = a very huge list of debug screens to choose from... :s
elDiablo
level5
level5
Posts: 3111
Joined: Thu Mar 14, 2002 12:23 pm
Location: London, UK

Re: Devs want cricket? Then first fix the basketball

Postby elDiablo » Wed Aug 03, 2016 9:21 am

Just saw this post too! To keep others in the loop, here's my reply:

Hey there,

Thanks for the email. The problem you encountered was probably due to the (boolean) AnimateVelocity property. There was a bug in the lua integration that was mis-casting bools to strings (or the other way around, I forget). Now that's fixed, it's probably the AnimateVelocity flag is correctly set. In the C++ code, this flag merely does

newPos = oldPos + vel * timePassed

(with a few checks for blocked movement and such). You could try uncommenting those lines and not multiplying the velocity by 10 (ensuring the velocity is normalised to the speed of the ball over a second).

As for the interface, thank you for bringing that to my attention, I'll get to fixing it!

Cheers
murgh
level2
level2
Posts: 232
Joined: Sat Jan 30, 2016 11:52 am

Re: Devs want cricket? Then first fix the basketball

Postby murgh » Wed Sep 21, 2016 10:54 am

Several mods, big and small, with and without scripts will crash with the new Update 10 test release...

Bug filed at http://bugs.introversion.co.uk/view.php?id=11281

Edit: the bug seems to be Rooms related -> zoning a custom room will crash to desktop.

Return to “Community Members”

Who is online

Users browsing this forum: No registered users and 23 guests