RTS Starter Kit and Creating units
by Emil Diego · in Torque Game Engine · 06/09/2005 (6:14 am) · 3 replies
I have downloaded and installed the RTS starter kit. I have been playing around with it for weeks and have created some textures, 3D models and interfaces. I have come to the point where I want to start placing some units. The docs start to get a little vague on how to do that. I have read the docs on the RTSUnit data block and I have created one for one of my units. It is getting included and compiled by the engine.
Here are my questions:
1) how do i create an instance of that unit? (Script or Tools)
2) Does anyone know of any resources specifically for RTS Style games?
Here is the file:
datablock RTSUnitData(terranScoutBlock : UnitBaseBlock)
{
shapeFile = "~/data/shapes/ships/terran/terran_scout.dts";
baseDamage = 50;
attackDelay = 32;
damagePlus = 3;
armor = 1;
moveSpeed = 4;
range = 12;
maxDamage = 250; //maxDamage = health
vision = 100;
boundingBox = "2.0 2.0 2.0";
};
function terranScoutBlock::onAttack(%this, %attacker, %target)
{
%damage = %attacker.getDataBlock().baseDamage;
if(%attacker.getNetModifier().baseDamage)
%damage *= %attacker.getNetModifier().baseDamage;
%armor = %target.getDataBlock().armor;
if(%target.getNetModifier().armor)
%armor *= %target.getNetModifier().armor;
if(%damage > %armor)
%damage -= %armor;
else
%damage = 0;
%target.applyDamage(%damage);
}
Here are my questions:
1) how do i create an instance of that unit? (Script or Tools)
2) Does anyone know of any resources specifically for RTS Style games?
Here is the file:
datablock RTSUnitData(terranScoutBlock : UnitBaseBlock)
{
shapeFile = "~/data/shapes/ships/terran/terran_scout.dts";
baseDamage = 50;
attackDelay = 32;
damagePlus = 3;
armor = 1;
moveSpeed = 4;
range = 12;
maxDamage = 250; //maxDamage = health
vision = 100;
boundingBox = "2.0 2.0 2.0";
};
function terranScoutBlock::onAttack(%this, %attacker, %target)
{
%damage = %attacker.getDataBlock().baseDamage;
if(%attacker.getNetModifier().baseDamage)
%damage *= %attacker.getNetModifier().baseDamage;
%armor = %target.getDataBlock().armor;
if(%target.getNetModifier().armor)
%armor *= %target.getNetModifier().armor;
if(%damage > %armor)
%damage -= %armor;
else
%damage = 0;
%target.applyDamage(%damage);
}
#2
06/09/2005 (7:06 am)
I didn't know there was a specific RTS forum. Thanx.
#3
06/09/2005 (10:20 am)
And take a look in the Resource area, specifically for the "World Domination through Collaboration" mod--it provides some pretty neat (if I do say so myself!) "industry standard" functionality, and can be used as a basis for your own ideas, or simply as a demonstration of a lot of the capabilities of the RTS-SK.
Torque Owner Chris Jones-Gill
all RTS related stuff is inside a special RTS Starter Kit Private Forums
including resources on how to place unit etc.
You can get to that forum if you have purchased the pack in 2 ways:
1st.
The quickest click on the Blue Forums text on the and scoll down to till you see it.
2nd which is best ;-)
Click on Edit Subscriptions on the left navbar
then check the box for RTS Starter Kit Private Forums
and hit submit
Under Subscribed Forums you will have the RTS Starter Kit Private Forums listed.
Hope this helps