Jump to content

LUA Zip Data Error


Benton
 Share

Recommended Posts

My code keeps getting a "Zip Data Error". No line number, nothing. Something about the main chunk. What is wrong here?

 

require("Scripts/constants/keycodes")
require("Scripts/linkedlist")
require("Scripts/filesystem")
require("scripts/math/math")
require("scripts/constants/engine_const")
RegisterAbstractPath("")
Graphics(1024,768)
fw = CreateFramework()
scene = LoadScene("abstract::deserthighway.sbx")
fw.main.camera:SetPosition(StringToVec3(scene:GetKey("cameraposition")))
start = scene:FindChild("start")
fw.main.camera:SetPosition(start:GetPosition(1))
FlushKeys()
HideMouse()
local camera = fw.main.camera
chassis=LoadModel("abstract::vehicle_viperscout.gmf")
carobject=objecttable[chassis]
car=carobject.vehicle
if car==nil then
Notify("Vehicle object not found.",1)
chassis:Free()
return
end
chassis:SetPosition(TFormPoint(Vec3(0,-1,10),fw.main.camera,nil))
chassis:SetRotationf(0,camera.rotation.y+180.0,0)
--Variables
local dx=0.0
local dy=0.0
local camerapitch=camera.rotation.x
local camerayaw=camera.rotation.y
local move=0.0
local strafe=0.0
local steering = 0.0
local torque = 0.0
local steerlimit = 30.0
local steerrate = 2.0
local steerangle=0.0
local prevmouseX = 750
MoveMouse(Round(GraphicsWidth()/2),Round(GraphicsHeight()/2))
while KeyHit(KEY_ESCAPE)==0 do

--Camera look
gx=Round(GraphicsWidth()/2)
gy=Round(GraphicsHeight()/2)
dx=Curve((MouseX()-gx)/4.0,dx,3.0/AppSpeed())
dy=Curve((MouseY()-gy)/4.0,dy,3.0/AppSpeed())
MoveMouse(gx,gy)
camerapitch=camerapitch+dy
camerayaw=camerayaw-dx
camerapitch=math.min(camerapitch,45)
camerapitch=math.max(camerapitch,10)
fw.main.camera:SetRotationf(camerapitch,chassis.rotation.y-180,0,1)

local tirespeed=-(KeyDown(KEY_UP)-KeyDown(KEY_DOWN))*2.0
car:AddTireTorque(tirespeed,0)
car:AddTireTorque(tirespeed,1)
car:AddTireTorque(tirespeed,2)
car:AddTireTorque(tirespeed,3)

steermode=0
changemouseX = MouseX() - prevmouseX
turnrad = changemouseX/10
steerangle=steerangle-turnrad*AppSpeed()
steerangle=Clamp(steerangle,-5,5)
car:SetSteerAngle(steerangle,0)
car:SetSteerAngle(steerangle,1)
steerangle=Clamp(steerangle,-25,25)
car:SetSteerAngle(steerangle,0)
car:SetSteerAngle(steerangle,1)

fw:Update()


local campos=TFormPoint(Vec3(0,1,0),chassis,nil)

fw.main.camera:SetPosition(campos)
fw.main.camera:Move(Vec3(0,0,-10))

local t=TFormVector(Vec3(0,0,1),camera,chassis)
a=-math.deg(math.atan2(t.x,t.z))+180.0

carobject.turret:SetRotationf(0,CurveAngle(a,carobject.turret.rotation.y,10.0/AppSpeed()),0)

chassis:Hide()
local pick = LinePick(campos,camera.position,0.5,COLLISION_PROP)
chassis:Show()
if pick~=nil then
 camera:SetPosition(pick.position)
end

fw:Render()
Flip(0)
end
chassis:Free()
chassis=nil
camera=nil
ShowMouse()

Windows 7 Professional 64 bit, 16 gigs ram, 3.30GHz Quad Core, GeForce GTX 460 one gig, Leadwerks 2.5, Blender 2.62, Photoshop CS3, UU3D

Link to comment
Share on other sites

My guess, the viperscout, its a protected asset and only for use in the editor.

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

Oh really? That sucks, I just wanted to use it until I intregrated my car model, but it's not easy to do that. Nothing wrong with the editor though. Thanks :P

Windows 7 Professional 64 bit, 16 gigs ram, 3.30GHz Quad Core, GeForce GTX 460 one gig, Leadwerks 2.5, Blender 2.62, Photoshop CS3, UU3D

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...