Problems with moveMap.bindCmd in Tactic view mode not fps view[SOLVED]
by Dwarf King · in Torque 3D Professional · 06/29/2013 (7:27 am) · 4 replies
So the Dwarf King is kind of stuck with a small nagging and buggy issue here.
The main task:
I am implementing a very simple inventory system for my little group of players. I have given them a nice bow and a sword.
That means that when the player clicks 1 he is given his bow(main weapon and equipped from the start with the glorious and most holy function of all called "setInventory(%this, %data, %value)").
When clicking 2 the same happens thanks to the very same function mention above. Now what is my problem then? Well the "%"&%"&��ïÿýïÿý���ï���ÿ���ý���ï���ÿ���ý��ïÿýïÿý���ï���ÿ���ý��ïÿýïÿý��ïÿý���ä" of system will not work in tactic mode, it only works in first person view, which is useless as my game is viewed in tactic mode.
Measured taken to fix this buggy issue:
1. delete config.cs
2. run deletePrefs
3. fire up Torsion again
Eeeeeek! did not work!
1. delete config.cs
2. run deletePrefs
3. rebuild project
4. fire up Torsion again
Eeeeeek! did not work!
Also did notice my config.cs file never came back after deleting it and doing the above stuff.
1. put back old config.cs file
2. made sure the moveMap.bindCmd was identical to default.bind.cs
Eeeeeek did not work!
So this is what I have in config.cs AND default.bind.cs:
moveMap.bindCmd(keyboard, "1", "commandToServer('use',"bow");", "");
moveMap.bindCmd(keyboard, "2", "commandToServer('use',"defaultSword");", "");
Now WHY is this only working in First person and third person view but NOT in my uber cool and awesome tactic on the fly move(circling around the player of course)?
Best,
Dwarf King
Issue solved a great thanks goes to Daniel Buckmaster & Nathan Martin for their great advice and suggestions.
The main task:
I am implementing a very simple inventory system for my little group of players. I have given them a nice bow and a sword.
That means that when the player clicks 1 he is given his bow(main weapon and equipped from the start with the glorious and most holy function of all called "setInventory(%this, %data, %value)").
When clicking 2 the same happens thanks to the very same function mention above. Now what is my problem then? Well the "%"&%"&��ïÿýïÿý���ï���ÿ���ý���ï���ÿ���ý��ïÿýïÿý���ï���ÿ���ý��ïÿýïÿý��ïÿý���ä" of system will not work in tactic mode, it only works in first person view, which is useless as my game is viewed in tactic mode.
Measured taken to fix this buggy issue:
1. delete config.cs
2. run deletePrefs
3. fire up Torsion again
Eeeeeek! did not work!
1. delete config.cs
2. run deletePrefs
3. rebuild project
4. fire up Torsion again
Eeeeeek! did not work!
Also did notice my config.cs file never came back after deleting it and doing the above stuff.
1. put back old config.cs file
2. made sure the moveMap.bindCmd was identical to default.bind.cs
Eeeeeek did not work!
So this is what I have in config.cs AND default.bind.cs:
moveMap.bindCmd(keyboard, "1", "commandToServer('use',"bow");", "");
moveMap.bindCmd(keyboard, "2", "commandToServer('use',"defaultSword");", "");
Now WHY is this only working in First person and third person view but NOT in my uber cool and awesome tactic on the fly move(circling around the player of course)?
Best,
Dwarf King
Issue solved a great thanks goes to Daniel Buckmaster & Nathan Martin for their great advice and suggestions.
About the author
GG really went down the drain in the end. What a shame. Hoped for more.
#2
Now, the literal cause of nothing happening is that you didn't call setInventory on your Camera object, for obvious reasons.
The problem is that in free-camera mode, the inventory scripts aren't set up to send your inventory command to a Player who is not your current control object. So you'll need to redo these scripts.
To start with, you'll probably want to modify the 'use' server command, and make it call the use function on your player character. Which, I think, would look like:
06/29/2013 (9:45 am)
The default inventory system operates on the client's control object, which, when you are in free-camera mode, is the Camera, not a Player. So when you are in free-camera mode and hit 1 or 2, the game tries to mount your weapons on the Camera.Now, the literal cause of nothing happening is that you didn't call setInventory on your Camera object, for obvious reasons.
The problem is that in free-camera mode, the inventory scripts aren't set up to send your inventory command to a Player who is not your current control object. So you'll need to redo these scripts.
To start with, you'll probably want to modify the 'use' server command, and make it call the use function on your player character. Which, I think, would look like:
%client.player.use(%data);You'll probably want to make other changes but that should get you started.
#3
Thanks for both replies, I am on both ideas at this very moment :o)
Best,
Dwarf King
06/29/2013 (11:32 am)
Awesome feedback :o)Thanks for both replies, I am on both ideas at this very moment :o)
Best,
Dwarf King
#4
in "function serverCmdUse(%client, %data)" I was missing!
So all along I have been calling the func setInventory on my camera ??? Lol!!
Thanks for the help. I hereby grant you one virtual beer/coke as a token of gratitude(well we do not have a rep system here so virtual beer/coke it must be).
06/29/2013 (12:34 pm)
Oiiiii! Indeed it was the %client.player.use(%data);
in "function serverCmdUse(%client, %data)" I was missing!
So all along I have been calling the func setInventory on my camera ??? Lol!!
Thanks for the help. I hereby grant you one virtual beer/coke as a token of gratitude(well we do not have a rep system here so virtual beer/coke it must be).
Torque Owner Nathan Martin
TRON 2001 Network