Game Development Community

Debugging the hell out of me - mounting weapons

by Andy Hawkins · in Torque Game Engine Advanced · 05/14/2006 (5:52 am) · 4 replies

So I'm using torsion and I just tested my character holding a Sword. It is mounted using the Sword_Image. Good - done. Next I swap out all the scripts and load the gun version, the character holds a Gun now - gun_image right - OH NO!!!!

Frickin' inventory.cs is still looking for Sword_Image during maxInventory and fails to mount the gun. I tried it out of torsion and it still fails.

Anyone run into trouble like this? Doesn't matter what I do, it can't find the gun because it's trying to load the sword image.

I've deleted DSOs, removed the sword scripts, even used Wingrep to see which files are trying to load sword_image - none of them are... I'm stumped!

#1
05/14/2006 (7:05 am)
It's been a long time since I've looked at the stock implimentation of things, but have you taken a close look at your weapon datablocks, and the scripts that use them? I would do a global project search for the datablock name of both weapons, and make sure you didn't miss something simple.

EDIT:
Instead of wingrep, you might try F from Torsion. Assuming you've created a project that has all the scripts files in it.
#2
05/14/2006 (7:43 am)
Meh! Found it - sorry for the disruption...

in game.cs .... GameConnection::createPlayer

// Starting equipment
   %player.setInventory(Sword_Image,1);
   %player.setInventory(Sword_Ammo,100); 
   %player.mountImage(Sword_Image,0);

...dumb :P
#3
05/14/2006 (7:48 am)
Na not dumb just should be in getting started or general. It's not really an "engine" issue.

Engine (subforum) is more for internals not game building.
#4
05/14/2006 (8:15 am)
Thanks for your help guys :) I thought it might be an engine issue because originally I couldn't see the problem in the script. Thanks again.