Imchasinyou Posted November 9, 2014 Share Posted November 9, 2014 Rick, ive tried this over and over. Im not seeing my error. Ive followed you line by line. The box disappears but im not getting the weapon prefab set in the vmodel. If you have a minute to look over the scripts and see if you see my issue, Id appreciate it greatly. The tutorials are great for us noob non coders. I have included the FPSPlayer, FPSWeapon, FPSGun and the Pick up script in my drop box to reduce the clutter here in the forums. https://www.dropbox.com/sh/6woj1ju95d95gxl/AACXJ2Kdfbw2B_WOnx_Z433oa?dl=0 Quote Asus sabertooth 990FX, AMD FX 9590 , Windows 7 Home Premium 64 Bit, 4 HDD's Western Digital Caviar Black set in Raid 0, 16 GB Crucial Ballistix Elite, Asus Radeon R9 270 X 4GB, Corsair CM750M, Link to comment Share on other sites More sharing options...
Genebris Posted November 9, 2014 Share Posted November 9, 2014 Your LoadWeapon function: function Script:LoadWeapon() --Load the default weapon, if one is set if self.weaponfile=="" then local entity = Prefab:Load (self.weaponfile) if entity ~=nil then System:Print("weapon file loaded") if entity.script~=nil then entity.script:Start() entity.script.player = self self.weapon = entity.script self.weapon.entity:SetParent(self.camera) self.weapon.entity:SetRotation(0,0,0) if self.weapon.offset~=nil then self.weapon.entity:SetPoint(self.weapon.offset) else self.weapon.entity:SetPosition(0,0,0) end end end end end The second line is: if self.weaponfile=="" then Shouldn't it be ~= instead of ==? Also, I suggest you making it like this: if self.weaponfile=="" then return end This will stop the function if wapon file path is empty. Quote Link to comment Share on other sites More sharing options...
Imchasinyou Posted November 9, 2014 Author Share Posted November 9, 2014 Ill have to look at the tutorial again to see if that is what was used. Maybe I didnt see it. Quote Asus sabertooth 990FX, AMD FX 9590 , Windows 7 Home Premium 64 Bit, 4 HDD's Western Digital Caviar Black set in Raid 0, 16 GB Crucial Ballistix Elite, Asus Radeon R9 270 X 4GB, Corsair CM750M, Link to comment Share on other sites More sharing options...
Genebris Posted November 9, 2014 Share Posted November 9, 2014 It's "~=" in his video: http://youtu.be/VWBGtJ7NQ4Y?t=13m25s Quote Link to comment Share on other sites More sharing options...
Imchasinyou Posted November 9, 2014 Author Share Posted November 9, 2014 I did find tyhat but didnt make any differance. Would it matter that i do not actually use a camera, I use the prefab player. Quote Asus sabertooth 990FX, AMD FX 9590 , Windows 7 Home Premium 64 Bit, 4 HDD's Western Digital Caviar Black set in Raid 0, 16 GB Crucial Ballistix Elite, Asus Radeon R9 270 X 4GB, Corsair CM750M, Link to comment Share on other sites More sharing options...
Genebris Posted November 9, 2014 Share Posted November 9, 2014 Do you see "weapon file loaded" message in the output? Quote Link to comment Share on other sites More sharing options...
Imchasinyou Posted November 9, 2014 Author Share Posted November 9, 2014 My output screen is all greyed out. If you are referring to the window that opens when you run the game with the actual window created by the game Id be happy to teamview this to find the error if your interested. You can add me on steam by searchign Gen - Imchasinyou Quote Asus sabertooth 990FX, AMD FX 9590 , Windows 7 Home Premium 64 Bit, 4 HDD's Western Digital Caviar Black set in Raid 0, 16 GB Crucial Ballistix Elite, Asus Radeon R9 270 X 4GB, Corsair CM750M, Link to comment Share on other sites More sharing options...
Genebris Posted November 9, 2014 Share Posted November 9, 2014 In WeaponPickup.lua you have entity.script.weaponfile = self.vmodel self.vmodel should be self.vModel (case sensitive). Line 28. Quote Link to comment Share on other sites More sharing options...
Imchasinyou Posted November 9, 2014 Author Share Posted November 9, 2014 getting better, i atleast have a small bit of lag as if its trying to load something with that change Quote Asus sabertooth 990FX, AMD FX 9590 , Windows 7 Home Premium 64 Bit, 4 HDD's Western Digital Caviar Black set in Raid 0, 16 GB Crucial Ballistix Elite, Asus Radeon R9 270 X 4GB, Corsair CM750M, Link to comment Share on other sites More sharing options...
Genebris Posted November 9, 2014 Share Posted November 9, 2014 Do you have "weapon file loaded" in console now? Quote Link to comment Share on other sites More sharing options...
Imchasinyou Posted November 9, 2014 Author Share Posted November 9, 2014 Im still not seeing anything along the line of a message Quote Asus sabertooth 990FX, AMD FX 9590 , Windows 7 Home Premium 64 Bit, 4 HDD's Western Digital Caviar Black set in Raid 0, 16 GB Crucial Ballistix Elite, Asus Radeon R9 270 X 4GB, Corsair CM750M, Link to comment Share on other sites More sharing options...
Imchasinyou Posted November 9, 2014 Author Share Posted November 9, 2014 something has occurred to me. I have seperate weapon scripts for each of my weapons. So, Im wondering if that has anythignt odo with my issues and if it does, Ill feel totally retarded! Quote Asus sabertooth 990FX, AMD FX 9590 , Windows 7 Home Premium 64 Bit, 4 HDD's Western Digital Caviar Black set in Raid 0, 16 GB Crucial Ballistix Elite, Asus Radeon R9 270 X 4GB, Corsair CM750M, Link to comment Share on other sites More sharing options...
Genebris Posted November 9, 2014 Share Posted November 9, 2014 There should be an output section in this grey window. You probably neeed to grag it from the right side of the vindow. Quote Link to comment Share on other sites More sharing options...
Imchasinyou Posted November 9, 2014 Author Share Posted November 9, 2014 Once upon a time, I had that very same window. I havnt seen it in some time. Ill see if its something I can find/fix Managed to get that back. . . . . Lemme see if I can find what you mentioned above Quote Asus sabertooth 990FX, AMD FX 9590 , Windows 7 Home Premium 64 Bit, 4 HDD's Western Digital Caviar Black set in Raid 0, 16 GB Crucial Ballistix Elite, Asus Radeon R9 270 X 4GB, Corsair CM750M, Link to comment Share on other sites More sharing options...
Imchasinyou Posted November 9, 2014 Author Share Posted November 9, 2014 Loading component "C:/Users/Andrew/Documents/Leadwerks/Projects/Zombies/scripts/objects/triggers/weaponpickup.lua..." Executing file "C:/Users/Andrew/Documents/Leadwerks/Projects/Zombies/scripts/objects/triggers/weaponpickup.lua" Loading component "C:/Users/Andrew/Documents/Leadwerks/Projects/Zombies/scripts/objects/player/fpsplayer.lua..." Executing file "C:/Users/Andrew/Documents/Leadwerks/Projects/Zombies/scripts/objects/player/fpsplayer.lua" Something like that? Im going to make a quick map, import the scripts over and see if anything changes from this level to a fresh level Quote Asus sabertooth 990FX, AMD FX 9590 , Windows 7 Home Premium 64 Bit, 4 HDD's Western Digital Caviar Black set in Raid 0, 16 GB Crucial Ballistix Elite, Asus Radeon R9 270 X 4GB, Corsair CM750M, Link to comment Share on other sites More sharing options...
Imchasinyou Posted November 9, 2014 Author Share Posted November 9, 2014 Same results here too. Here is the consoles log. Executing "C:\Users\Andrew\Documents\Leadwerks\Projects\GunTutorial\GunTutorial.exe"... Initializing Lua... Lua sandboxing enabled. Executing file "C:/Users/Andrew/Documents/Leadwerks/Projects/GunTutorial/Scripts/Error.lua" Executing file "C:/Users/Andrew/Documents/Leadwerks/Projects/GunTutorial/Scripts/App.lua" Initializing OpenGL4 graphics driver... OpenGL version 431 GLSL version 430 Device: ASUS R9 270X Series Loading map "C:/Users/Andrew/Documents/Leadwerks/Projects/GunTutorial/Maps/start.map"... Loading material "C:/Users/Andrew/Documents/Leadwerks/Projects/GunTutorial/materials/developer/bluegrid.mat"... Loading texture "C:/Users/Andrew/Documents/Leadwerks/Projects/GunTutorial/materials/developer/BlueGrid.tex"... Loading shader "C:/Users/Andrew/Documents/Leadwerks/Projects/GunTutorial/Shaders/Model/diffuse.shader"... Loading texture "C:/Users/Andrew/Documents/Leadwerks/Projects/GunTutorial/Materials/Common/bfn.tex"... Loading component "C:/Users/Andrew/Documents/Leadwerks/Projects/GunTutorial/scripts/objects/player/fpsplayer.lua..." Executing file "C:/Users/Andrew/Documents/Leadwerks/Projects/GunTutorial/scripts/objects/player/fpsplayer.lua" Executing file "C:/Users/Andrew/Documents/Leadwerks/Projects/GunTutorial/Scripts/Functions/ReleaseTableObjects.lua" Loading component "C:/Users/Andrew/Documents/Leadwerks/Projects/GunTutorial/scripts/objects/triggers/weaponpickup.lua..." Executing file "C:/Users/Andrew/Documents/Leadwerks/Projects/GunTutorial/scripts/objects/triggers/weaponpickup.lua" Loading shader "C:/Users/Andrew/Documents/Leadwerks/Projects/GunTutorial/Shaders/Terrain/stamp.shader"... Loading shader "C:/Users/Andrew/Documents/Leadwerks/Projects/GunTutorial/Shaders/Terrain/updatenormals.shader"... Loading shader "C:/Users/Andrew/Documents/Leadwerks/Projects/GunTutorial/Shaders/Terrain/clear.shader"... Loading shader "C:/Users/Andrew/Documents/Leadwerks/Projects/GunTutorial/Shaders/Terrain/clipmap.shader"... Loading shader "C:/Users/Andrew/Documents/Leadwerks/Projects/GunTutorial/Shaders/Terrain/terrain.shader"... Loading texture "C:/Users/Andrew/Documents/Leadwerks/Projects/GunTutorial/materials/nature/terrain_savannah_dirt.tex"... Loading texture "C:/Users/Andrew/Documents/Leadwerks/Projects/GunTutorial/Materials/HUD/crosshair.tex"... Loading texture "C:/Users/Andrew/Documents/Leadwerks/Projects/GunTutorial/Materials/HUD/use.tex"... Loading texture "C:/Users/Andrew/Documents/Leadwerks/Projects/GunTutorial/Materials/HUD/blood1.tex"... Loading texture "C:/Users/Andrew/Documents/Leadwerks/Projects/GunTutorial/Materials/HUD/blood2.tex"... Loading texture "C:/Users/Andrew/Documents/Leadwerks/Projects/GunTutorial/Materials/HUD/blood3.tex"... Loading texture "C:/Users/Andrew/Documents/Leadwerks/Projects/GunTutorial/Materials/HUD/blood4.tex"... Loading sound "C:/Users/Andrew/Documents/Leadwerks/Projects/GunTutorial/Sound/Player/flashlight_02_on.wav..." Loading sound "C:/Users/Andrew/Documents/Leadwerks/Projects/GunTutorial/Sound/Impact/body_punch_03.wav..." Loading sound "C:/Users/Andrew/Documents/Leadwerks/Projects/GunTutorial/Sound/Impact/body_punch_04.wav..." Loading sound "C:/Users/Andrew/Documents/Leadwerks/Projects/GunTutorial/Sound/Player/pickupammo.wav..." Loading sound "C:/Users/Andrew/Documents/Leadwerks/Projects/GunTutorial/Sound/Footsteps/Concrete/step1.wav..." Loading sound "C:/Users/Andrew/Documents/Leadwerks/Projects/GunTutorial/Sound/Footsteps/Concrete/step2.wav..." Loading sound "C:/Users/Andrew/Documents/Leadwerks/Projects/GunTutorial/Sound/Footsteps/Concrete/step3.wav..." Loading sound "C:/Users/Andrew/Documents/Leadwerks/Projects/GunTutorial/Sound/Footsteps/Concrete/step4.wav..." Loading sound "C:/Users/Andrew/Documents/Leadwerks/Projects/GunTutorial/Sound/Footsteps/Concrete/jump.wav..." weapon file = Loading shader "C:/Users/Andrew/Documents/Leadwerks/Projects/GunTutorial/Shaders/Model/default.shader"... Loading shader "C:/Users/Andrew/Documents/Leadwerks/Projects/GunTutorial/Shaders/Misc/occlusionquery.shader"... Loading shader "C:/Users/Andrew/Documents/Leadwerks/Projects/GunTutorial/Shaders/Lighting/ambientlight.shader"... Loading prefab "C:/Users/Andrew/Documents/Leadwerks/Projects/GunTutorial/Prefabs/Weapons/PPSH.pfb"... Loading model "C:/Users/Andrew/Documents/Leadwerks/Projects/GunTutorial/models/weapons/ppsh/ppsh.mdl" Loading material "C:/Users/Andrew/Documents/Leadwerks/Projects/GunTutorial/models/weapons/ppsh/ppsh.mat"... Loading shader "C:/Users/Andrew/Documents/Leadwerks/Projects/GunTutorial/Shaders/Model/Animated/diffuse+normal.shader"... Loading shader "C:/Users/Andrew/Documents/Leadwerks/Projects/GunTutorial/Shaders/Model/Shadow/shadow+animation.shader"... Loading texture "C:/Users/Andrew/Documents/Leadwerks/Projects/GunTutorial/models/weapons/ppsh/ppsh.tex"... Loading texture "C:/Users/Andrew/Documents/Leadwerks/Projects/GunTutorial/models/weapons/ppsh/ppsh_dot3.tex"... Loading component "C:/Users/Andrew/Documents/Leadwerks/Projects/GunTutorial/scripts/objects/weapons/ppsh.lua..." Executing file "C:/Users/Andrew/Documents/Leadwerks/Projects/GunTutorial/scripts/objects/weapons/ppsh.lua" Executing file "C:/Users/Andrew/Documents/Leadwerks/Projects/GunTutorial/Scripts/AnimationManager.lua" Loading sound "C:/Users/Andrew/Documents/Leadwerks/Projects/GunTutorial/Sound/Ricochet/bullet_impact_dirt_01.wav..." Loading sound "C:/Users/Andrew/Documents/Leadwerks/Projects/GunTutorial/Sound/Ricochet/bullet_impact_dirt_02.wav..." Loading sound "C:/Users/Andrew/Documents/Leadwerks/Projects/GunTutorial/Sound/Ricochet/bullet_impact_dirt_03.wav..." Loading material "C:/Users/Andrew/Documents/Leadwerks/Projects/GunTutorial/Materials/Effects/tracer.mat"... Loading texture "C:/Users/Andrew/Documents/Leadwerks/Projects/GunTutorial/Materials/Effects/tracer.tex"... Loading sound "C:/Users/Andrew/Documents/Leadwerks/Projects/GunTutorial/Sound/Weapons/Autopistol/revolver_dry_fire_01.wav..." Loading sound "C:/Users/Andrew/Documents/Leadwerks/Projects/GunTutorial/Sound/Weapons/Autopistol/gun_357mag_01.wav..." Loading sound "C:/Users/Andrew/Documents/Leadwerks/Projects/GunTutorial/Sound/Weapons/Autopistol/gun_357mag_02.wav..." Loading sound "C:/Users/Andrew/Documents/Leadwerks/Projects/GunTutorial/Sound/Weapons/Autopistol/gun_357mag_05.wav..." Loading sound "C:/Users/Andrew/Documents/Leadwerks/Projects/GunTutorial/Sound/Weapons/Autopistol/bullet_load_into_chamber_02.wav..." Loading material "C:/Users/Andrew/Documents/Leadwerks/Projects/GunTutorial/Materials/Effects/muzzleflash.mat"... Loading shader "C:/Users/Andrew/Documents/Leadwerks/Projects/GunTutorial/shaders/model/flat/diffuse.shader"... Loading texture "C:/Users/Andrew/Documents/Leadwerks/Projects/GunTutorial/Materials/Effects/muzzleflash.tex"... Loading material "C:/Users/Andrew/Documents/Leadwerks/Projects/GunTutorial/Materials/Effects/default.mat"... Loading shader "C:/Users/Andrew/Documents/Leadwerks/Projects/GunTutorial/shaders/particles/default.shader"... Loading texture "C:/Users/Andrew/Documents/Leadwerks/Projects/GunTutorial/Materials/Effects/default.tex"... Loading material "C:/Users/Andrew/Documents/Leadwerks/Projects/GunTutorial/Materials/Effects/smoke.mat"... Loading texture "C:/Users/Andrew/Documents/Leadwerks/Projects/GunTutorial/Materials/Effects/smoke_particle.tex"... Loading material "C:/Users/Andrew/Documents/Leadwerks/Projects/GunTutorial/Materials/Effects/bloodspatter.mat"... Loading texture "C:/Users/Andrew/Documents/Leadwerks/Projects/GunTutorial/Materials/Effects/bloodspatter.tex"... weapon file loaded Setting breakpad minidump AppID = 251810 Steam_SetMinidumpSteamID: Caching Steam ID: 76561198039260066 [API loaded no] Process Complete. Quote Asus sabertooth 990FX, AMD FX 9590 , Windows 7 Home Premium 64 Bit, 4 HDD's Western Digital Caviar Black set in Raid 0, 16 GB Crucial Ballistix Elite, Asus Radeon R9 270 X 4GB, Corsair CM750M, Link to comment Share on other sites More sharing options...
Genebris Posted November 9, 2014 Share Posted November 9, 2014 Try replacing this: if self.weapon.offset~=nil then self.weapon.entity:SetPoint(self.weapon.offset) else self.weapon.entity:SetPosition(0,0,0) end with this: self.weapon.entity:SetPosition(0,0,100) Quote Link to comment Share on other sites More sharing options...
Imchasinyou Posted November 9, 2014 Author Share Posted November 9, 2014 Tried that, if this is what you meant. function Script:LoadWeapon() --Load the default weapon, if one is set if self.weaponfile~="" then local entity = Prefab:Load(self.weaponfile) if entity~=nil then System:Print("weapon file loaded") if entity.script~=nil then entity.script:Start() entity.script.player = self self.weapon = entity.script self.weapon.entity:SetParent(self.camera) self.weapon.entity:SetRotation(0,0,0) self.weapon.entity:SetPosition(0,0,100) end end end end That didnt work. Its just not loading that prefab weapon. Its like it knows it needs to but cant find it or something. Quote Asus sabertooth 990FX, AMD FX 9590 , Windows 7 Home Premium 64 Bit, 4 HDD's Western Digital Caviar Black set in Raid 0, 16 GB Crucial Ballistix Elite, Asus Radeon R9 270 X 4GB, Corsair CM750M, Link to comment Share on other sites More sharing options...
Genebris Posted November 9, 2014 Share Posted November 9, 2014 Are you sure you have correct file path and correct prefab? "weapon file loaded" shows and it means something is loaded. If you want to use teamviewer ask Rick or someone else, I can't help you with that, sorry. Or send me the whole project dirrectory and I'll look into it tomorrow. Quote Link to comment Share on other sites More sharing options...
Imchasinyou Posted November 9, 2014 Author Share Posted November 9, 2014 Im going to export this map and post it to my drop box. If you dot mind, take a look at it and see if everything is there. Quote Asus sabertooth 990FX, AMD FX 9590 , Windows 7 Home Premium 64 Bit, 4 HDD's Western Digital Caviar Black set in Raid 0, 16 GB Crucial Ballistix Elite, Asus Radeon R9 270 X 4GB, Corsair CM750M, Link to comment Share on other sites More sharing options...
Imchasinyou Posted November 9, 2014 Author Share Posted November 9, 2014 https://www.dropbox.com/sh/0dvu1s6yuwhbnnl/AAC5HHuFpB7s58oXq-Tycjgda?dl=0 This contains my empty map with the weapon pick up script if any one is so inclined to have a peek to see why it wont work. Quote Asus sabertooth 990FX, AMD FX 9590 , Windows 7 Home Premium 64 Bit, 4 HDD's Western Digital Caviar Black set in Raid 0, 16 GB Crucial Ballistix Elite, Asus Radeon R9 270 X 4GB, Corsair CM750M, Link to comment Share on other sites More sharing options...
Genebris Posted November 10, 2014 Share Posted November 10, 2014 Ok, so you were using Rick's weapon loading mechanism with with weapons that already have this mechanism programmed. In the end of the start function of FPSPlayer script you have these lines: if self.weaponfile~="" then local prefab = Prefab:Load(self.weaponfile) if prefab~=nil then if prefab.script~=nil then self:AddWeapon(prefab.script) else prefab:Release() end end end This is how loading of these weapons work (they have everything else in their start function). And this is what your LoadWeapon function should be. So I simply commented out your LoadWeapon function and added new one with this code. And I have commented out this code from player start function so the weapon won't be loaded at start twice. Here is the link to modified FPSPlayer.lua: http://pastebin.com/UNyPvtim Quote Link to comment Share on other sites More sharing options...
Josh Posted November 10, 2014 Share Posted November 10, 2014 The FPS weapons pack has examples of this. Due out very very soon. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Imchasinyou Posted November 10, 2014 Author Share Posted November 10, 2014 This works perfectly. Now can the player carry 2 weapons and choose between them or is that a seperate function? man I need a dedicated scripter to help me :/. . . . Quote Asus sabertooth 990FX, AMD FX 9590 , Windows 7 Home Premium 64 Bit, 4 HDD's Western Digital Caviar Black set in Raid 0, 16 GB Crucial Ballistix Elite, Asus Radeon R9 270 X 4GB, Corsair CM750M, Link to comment Share on other sites More sharing options...
Imchasinyou Posted November 10, 2014 Author Share Posted November 10, 2014 The FPS weapons pack has examples of this. Due out very very soon. Come on! Stop teasing me and just give it up already. Quote Asus sabertooth 990FX, AMD FX 9590 , Windows 7 Home Premium 64 Bit, 4 HDD's Western Digital Caviar Black set in Raid 0, 16 GB Crucial Ballistix Elite, Asus Radeon R9 270 X 4GB, Corsair CM750M, Link to comment Share on other sites More sharing options...
Recommended Posts
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.