MountImage
by Howard Dortch · in Torque Game Engine · 08/05/2005 (2:55 pm) · 3 replies
After a player is created I can set their inventory with a weapon and mountImage for the weapon. Can someone tell me if this weapon actually exists as an object using mountImage? I dont see that it is created.
Reason for this is I wanted to modify the data for weapons on a per player basis. As in my gun shoots farther or faster than your gun but it's the same gun.
I guess I have to create an instance of the gun object, set the attributes then give it to the player?
Reason for this is I wanted to modify the data for weapons on a per player basis. As in my gun shoots farther or faster than your gun but it's the same gun.
I guess I have to create an instance of the gun object, set the attributes then give it to the player?
#2
08/05/2005 (4:42 pm)
I kinda figured it was something like that. When there is a gun object laying on the ground and you do the collide/pickup and add to inventory it should exist as an object in the world and in your inventory but when you mount it you dont mount the object from the inventory you just mount it. At least I can't find an object that gets mounted so I can only assume a gun as defined is the same gun for all using the dataBlock rather than an object. Any ideas on how to trick the gun datablock to be different for different clients?
#3
08/06/2005 (8:58 pm)
I'm a little unclear what's going on here... If you want you can mount any ShapeBaseImageData you like (ergo, any image) and put any code you want in the onFire method (including checking for properties on the player). I believe there are some resources to implement modified firing rates and such, or you could just make a number of different images to use in different situations.
Torque Owner Matthew Livingstone
To make the gun shoot faster/farther for each player, you could jsut change the weapon::onFire function (in crossbow.cs) to pull variables from the player and then use those to calculate poer and speed. If you need any other information on this, just ask, no one knows everything :P.
EDIT: Spelling...