New to Torque, need help with QC file for Elf
by Vickie Eagle · in Technical Issues · 02/12/2007 (7:30 pm) · 9 replies
Hi, I'm very new to torque and wanted to know if someone could help me set up the animated Elf character that comes with the 1.5 version of torque. I look at the QC file and see how it is constructed but if I change the path to in the elf character model for the engine to use it instead of the Orc it doesn't work for me. Could someone help me to get the elf to work in place of the Orc?
you guys are great! Love the engine~
thanks for your help!
always~
Vickie ;)
you guys are great! Love the engine~
thanks for your help!
always~
Vickie ;)
#2
Just copy the content of tge-elf directory located in demo folder to the shapes/player/ folder located in starter.fps and rename elf.dts and elf.cs to player.dts and player.cs.
Less fast:
Open player.cs in server scripts folder, find (use texteditor's find function) player.dts and player.cs and change the path and names to point where your dts and animation script is located.
Note: there two player.cs, one in server folder, where is called the other player.cs located in shapes/player wich contain the animation settings. Don't get confused.
Bye
02/14/2007 (1:22 am)
Fast:Just copy the content of tge-elf directory located in demo folder to the shapes/player/ folder located in starter.fps and rename elf.dts and elf.cs to player.dts and player.cs.
Less fast:
Open player.cs in server scripts folder, find (use texteditor's find function) player.dts and player.cs and change the path and names to point where your dts and animation script is located.
Note: there two player.cs, one in server folder, where is called the other player.cs located in shapes/player wich contain the animation settings. Don't get confused.
Bye
#5
What's the weapon your Elf is mounting ? Is the crossbow ?
02/16/2007 (1:20 am)
Thanks for screenshoot Vickie.What's the weapon your Elf is mounting ? Is the crossbow ?
#6
she is using the default crossbow. I haven't figured out how to mount other weapons yet~
but I'm working on it :) I think I'm going to have to buy the torque book
always~
Vickie ;)
03/05/2007 (7:40 pm)
Hi Gianfranco Barone,she is using the default crossbow. I haven't figured out how to mount other weapons yet~
but I'm working on it :) I think I'm going to have to buy the torque book
always~
Vickie ;)
#7
A little hint
In order to mount another weapon or more weapons (a copy and paste of from my personal torque notes):
1.) In server/scripts/game.cs
- Replace the following code to GameConnection::createPlayer
%player.setInventory(Crossbow,1);
%player.setInventory(CrossbowAmmo,10);
%player.mountImage(CrossbowImage,0);
with
%player.setInventory(YourWeapon,1);
%player.setInventory(YourWeaponAmmo,10);
%player.mountImage(YourWeaponImage,0);
example:
%player.setInventory(ak47,1);
%player.setInventory(ak47Ammo,10);
%player.mountImage(ak47Image,0);
This will create the player with the selected weapon and ammo (In the example your player will have on start the ak47 and 10 ammo using slot 0).
2.) In server/scripts/player.cs
- Add the following code to bottom of PlayerData(PlayerBody)
maxInv[YourWeaponAmmo] = 150; // Assuming 150 is your maximum ammo
maxInv[YourWeapon] = 1;
Repeat step 2 as many times as is the number of your weapons. This just tells what and how many weapons and ammo your player is able to pick-up.
3.) In client/config.cs
- Add the following code
moveMap.bindCmd(keyboard, "1", "commandToServer(\'use\',\"YourWeapon1\");", "");
moveMap.bindCmd(keyboard, "2", "commandToserver(\'use\',\"YourWeapon2\");", "");
moveMap.bindCmd(keyboard, "3", "commandToserver(\'use\',\"YourWeapon3\");", "");
...(and so on)
example:
moveMap.bindCmd(keyboard, "1", "commandToServer(\'use\',\"Crossbow\");", "");
moveMap.bindCmd(keyboard, "2", "commandToserver(\'use\',\"barrett_xm500\");", "");
moveMap.bindCmd(keyboard, "3", "commandToserver(\'use\',\"m16\");", "");
This will map the keys to the selected weapons.
In the world creator, put weapon in the world, pick-up them and the mapping let you switch the weapons.
Homever I assume that you have already the weapon's dts and cs files.
That's for player.
For the AIplayer, i suggest you to take a look here (Shameless selfpromoting, I know :-)
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=12171
This is a little editor (and beta version too) to make simple AI character, where you can set the weapon his mounting, and the shape and so on. The app is very simple but it's free (run on windows xp).
And yes probably to buy the book is a good idea.
Gianfranco :P
03/06/2007 (2:36 am)
@Vickie, fiuuu... a terrible fast reply (I'm joking ;)A little hint
In order to mount another weapon or more weapons (a copy and paste of from my personal torque notes):
1.) In server/scripts/game.cs
- Replace the following code to GameConnection::createPlayer
%player.setInventory(Crossbow,1);
%player.setInventory(CrossbowAmmo,10);
%player.mountImage(CrossbowImage,0);
with
%player.setInventory(YourWeapon,1);
%player.setInventory(YourWeaponAmmo,10);
%player.mountImage(YourWeaponImage,0);
example:
%player.setInventory(ak47,1);
%player.setInventory(ak47Ammo,10);
%player.mountImage(ak47Image,0);
This will create the player with the selected weapon and ammo (In the example your player will have on start the ak47 and 10 ammo using slot 0).
2.) In server/scripts/player.cs
- Add the following code to bottom of PlayerData(PlayerBody)
maxInv[YourWeaponAmmo] = 150; // Assuming 150 is your maximum ammo
maxInv[YourWeapon] = 1;
Repeat step 2 as many times as is the number of your weapons. This just tells what and how many weapons and ammo your player is able to pick-up.
3.) In client/config.cs
- Add the following code
moveMap.bindCmd(keyboard, "1", "commandToServer(\'use\',\"YourWeapon1\");", "");
moveMap.bindCmd(keyboard, "2", "commandToserver(\'use\',\"YourWeapon2\");", "");
moveMap.bindCmd(keyboard, "3", "commandToserver(\'use\',\"YourWeapon3\");", "");
...(and so on)
example:
moveMap.bindCmd(keyboard, "1", "commandToServer(\'use\',\"Crossbow\");", "");
moveMap.bindCmd(keyboard, "2", "commandToserver(\'use\',\"barrett_xm500\");", "");
moveMap.bindCmd(keyboard, "3", "commandToserver(\'use\',\"m16\");", "");
This will map the keys to the selected weapons.
In the world creator, put weapon in the world, pick-up them and the mapping let you switch the weapons.
Homever I assume that you have already the weapon's dts and cs files.
That's for player.
For the AIplayer, i suggest you to take a look here (Shameless selfpromoting, I know :-)
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=12171
This is a little editor (and beta version too) to make simple AI character, where you can set the weapon his mounting, and the shape and so on. The app is very simple but it's free (run on windows xp).
And yes probably to buy the book is a good idea.
Gianfranco :P
#8
Well I'm off to play with this new code you gave me, I'll post a pic after I get the new weapon mounted.
thanks again Gianfranco~
always~
Vickie ;)
03/06/2007 (6:51 am)
Gianfranco you are a great help! Thank you~ I was looking at your AI tool it looks really awesome, I didn't know you were a member of the GGE, you can add me to your buddy list if you want :D I'm in the GGE also~Well I'm off to play with this new code you gave me, I'll post a pic after I get the new weapon mounted.
thanks again Gianfranco~
always~
Vickie ;)
#9
Thank for nice comments about AI tool.
GGE ?! Oh yes I'm completly forget I'm GGE member -> Uploaded some content on the profile and made a invitation to you to join my buddy list (which look pretty poor :-(.
Waiting for new pic...
bye
Gianfranco
03/06/2007 (11:10 am)
@VickieThank for nice comments about AI tool.
GGE ?! Oh yes I'm completly forget I'm GGE member -> Uploaded some content on the profile and made a invitation to you to join my buddy list (which look pretty poor :-(.
Waiting for new pic...
bye
Gianfranco
Torque Owner Lee Latham
Default Studio Name
Otherwise, study the player.cs file, and I think you will see the significant bits, in particular the datablock.