Showing posts with label Torque Game Engine. Show all posts
Showing posts with label Torque Game Engine. Show all posts

Tuesday, March 17, 2009

My 5'th resource @ Garagegames "3D Arrow aiming to objective target"


This resource will give you a 3D arrow (or any object you like) aiming to the target object you want.

This is the preview of how this works.


you can download it here www.geocities.com/herrudarmadi/3darrow.zip
place it on data/shapes/direction/arrow.dts

first add this to your server/game.cs

$aimTarget = 0;

function GameConnection::AimTarget( %this )
{
if($aimTarget)
{
%player = %this.player;
%target = $aimTarget;

%playerTrans = (%player.getTransform());
%xPlayer = getWord(%playerTrans, 0);
%yPlayer = getWord(%playerTrans, 1);
%zRot = getWord(%playerTrans, 5);
%playerRot = getWord(%playerTrans, 6);

%targetPosition = (%target.getPosition());
%xTarget = getWord(%targetPosition, 0);
%yTarget = getWord(%targetPosition, 1);

%xDiff = %xTarget - %xPlayer;
%yDiff = %yTarget - %yPlayer;

// dont have to change it to degrees
// torque engine automatically change it to degrees
%rotToTarget = mAtan(%xDiff, %yDiff);

if(%zRot < 0)
%playerRot = (2 * 22/7) - %playerRot;

// multiply by -1 because the rotation in 3dspace is
// oppositing the guiobjectview rotation
%rotation = -1 * (%rotToTarget - %playerRot);

commandToClient(%this, 'SetDirection', %rotation);
}
%this.schedule(100, AimTarget);
}

on the client/ui/playgui.gui add

new GuiObjectView(direction) {
canSaveDynamicFields = "0";
Profile = "GuiDefaultProfile";
HorizSizing = "center";
VertSizing = "bottom";
position = "244 94";
Extent = "149 149";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
hovertime = "1000";
applyFilterToChildren = "1";
cameraZRot = "0";
forceFOV = "0";
lightDirection = "-0.57735 -0.57735 -0.57735";
lightColor = "0.6 0.58 0.5 1";
ambientColor = "0.3 0.3 0.3 1";
emapAmount = "1";
};


and on the client/playgui.cs add

function PlayGui::onWake(%this)
{
// Turn off any shell sounds...
// alxStop( ... );
$enableDirectInput = "1";
activateDirectInput();
direction.setObject("gb","mod/data/shapes/direction/arrow.dts","","");

// Activate the game's action map
moveMap.push();
}

function clientCmdSetDirection(%rotation)
{
direction.setRotation(0, %rotation );
}

how to use it ?

just set the $aimTarget to any object id in your mission.
then call the gameConnection method aimTarget().

that's it, hope this resource usefull. cheers!

Friday, December 12, 2008

IDC Xmas Game 2008 finished

Download and try the game now !

The game is about celebrating the next Christmas by giving Greeting cards to the IDC Binus staff within 30 seconds. Be sure to make it in time! Enjoy the game and Merry Christmas ho ho ho..

visit http://www.herusan.com/xmas to try the game! ho ho ho

Friday, September 12, 2008

Kendo Boy 3D pre-alpha version

Still bugs hangin around, well I think it's time to release it in pre-alpha version. Of course to get any input and comments from u all :)
GamePlay: Its all about typing game, just type in the word(s) shown on the top of the input box while the battle is running. Who's faster and correct can hit their opponent, and vice versa.

Here's some screenshots:
Main Menu
Host Game Menu
Join/Challenge Menu
Loading the game
before the game started

well the game started, start typing!!!

FYI: the game needs 2 players connected via network to play.

to play the game you can download it from here : http://rapidshare.com/files/144690045/kendoboyinstaller.msi
Cheers.

Monday, September 1, 2008

Kendo Boy 3D


Yesterday, i started to create this kendo boy game. Based on 2d flash game kendo boy developed by HIMTI BINUS. The game is overall 40% done and the gameplay is similiar with the 2d version, but with multiplayer (2 player) via LAN can battle their speed typing skill here.

well this is the screenshot for the main menu

Thursday, August 7, 2008

Game Progress... till 070808

Hey, my simplest model finally done. Inspired by Lego thx! Here it is ... Boyz and Galz using office suit hehe.. looks funny in there.


The model and animation created using milkshape.


If you want it in your project, just contact me and i'll give it for free ^^.

Thursday, July 24, 2008

Watermark for TGE

Sometimes you dont want your engine used by other, so why dont use watermark ?

add this snippet to your engine/gui/core/guicanvas.cc on void GuiCanvas::renderFrame(bool preRenderOnly, bool bufferSwap /* = true */) exactly after




if (cursorON && mouseCursor && mShowCursor)
{
Point2I pos((S32)cursorPt.x, (S32)cursorPt.y);
Point2I spot = mouseCursor->getHotSpot();

pos -= spot;
mouseCursor->render(pos);
}




This is the code, and after adding this you should rebuild the engine.




// enable/disable watermark ?
bool WT = true;

if(WT)
{
// get the default profile for text
GuiControlProfile *mtProfile;
mtProfile = NULL;

// Ok lets check to see if that worked
if( !mtProfile ) {
SimObject *obj = Sim::findObject( "GuiDefaultProfile" );

if( obj )
mtProfile = dynamic_cast(obj);
else
return;
}

if(mtProfile)
{
// changed the text into your watermark text
const char* wtText = "TGE Licenced HD";

ColorF mForegroundColor;
mForegroundColor.set( 1, 1, 1, 1 );
ColorI mFillColor;

//Vars used:
//Screensize (for position check)
//Offset to get position of cursor
//textBounds for text extent.
Point2I offset;
Point2I textBounds;
S32 textWidth = mtProfile->mFont->getStrWidth(renderTip);

//Create text bounds.
textBounds.x = textWidth+8;
textBounds.y = mtProfile->mFont->getHeight() + 4;

//Offset below cursor image
offset.y = size.y - textBounds.y - 10;
offset.x = size.x - textBounds.x - 10;

// Set rectangle for the box, and set the clip rectangle.
RectI rect(offset, textBounds);
dglSetClipRect(rect);

mFillColor.set(0,0,0,255);
dglDrawRectFill(rect, mFillColor);

mFillColor.set(255,255,255,255);
dglDrawRect( rect, mFillColor );

// Draw the text centered in the tool tip box
dglSetBitmapModulation( mForegroundColor );
Point2I start;
start.set( ( textBounds.x - textWidth) / 2, ( textBounds.y - mtProfile->mFont->getHeight() ) / 2 );
dglDrawText( mtProfile->mFont, start + offset, wtText, mtProfile->mFontColors );
dglClearBitmapModulation();

// end hd watermark
}

// free the pointer ?
mtProfile = NULL;
}

Monday, July 7, 2008

My second resource @ GG for Torque Game Engine :: Grow and Shrink GUI

The resource is about GUI animation which can grow and shrink.

Here's the link to the complete resource and comments
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=15018

And this is the result when applying the resource

Cheers!

Sunday, July 6, 2008

Multiplayer Gaming and Engine Coding for the Torque Game Engine


Yes, after waiting about 3 weeks the book finally arrived :D.

Well the book contents is quite easy to understand and makin a few things more clear to me. And after a few hours reading it, I soon realized that it's already chapter 4 of 14.

Saturday, June 28, 2008

My 3D Office Day 4-5



Added 3d sound emitter, particle emitter for sound notes, and snow precipitation.

Hey the TGE Elf dancing on the set by diana krall song lets fall in love,
Enjoy!

Wednesday, June 25, 2008

My 3D Office day 1 & 2


day 1: 24-06-08
Day 1 of makin my 3d office using torque constructor for the first time! its kinda fun hehe.. then adding some objects that i've created using milkshape (tables, cpu, and lcd). thx to FRP again for the wall textures. I love rabbids so there they are ^^.

Day 2: 25-05-08

Day 2 changed lcd to crt monitors :D added some IFL(Image File Lists) animation for the screens. added chairs and put some pc's on the tables. and make the scene more toonish using outline mod.

Hehe cant wait till tomorrow !!

Tuesday, February 5, 2008

Character Building (CB112) Course in a Game ?

Maybe it'll be nice if we learn this course in adventure game.

It'll be look like this.. (maybe)

FYI : before giving comment to the arts, this is programmer's art (i made it myself). please note that hahaha..

Wednesday, September 26, 2007

Penguin Arena - Wins Intel Game Demo Contest 2007 - Congrats

Frogames just releases Penguins Arena - Sedna's World for Windows and Mac OS X.An innovative, non violent, exciting and colorful FPS: the real First Penguin Shooter!And our game gets what it takes: Penguins Arena is a prize-winner of the Intel(r) Game Demo Contest among 145 entries from 29 countries around the world! Penguins Arena has won the 1st-place prize in the Best Game on the Go category and the award for the Best use of Torque in a game demo!

Indeed Penguins Arena is a fun, cartoonish and challenging game with an underlying message that's as real as today's headlines. What a great way to combine fun, computers and gaming to convey an urgent environmental message to people of all ages.It is also a First Person Shooter with no blood, just snowballs ; very short rounds ; reincarnations system and player interaction even when its tribe is eliminated. And of course it's a multiplayer game (LAN and Internet).Penguins Arena - Sedna's World is available for Windows and MACOS X. It was made with the Torque Game Engine.

Saturday, September 8, 2007

My Bachelor Thesis application - Edugame - Geogame

This is the screenshots of the Geogame application that me and my bachelor thesis partner Hendy create. The game is about learning geography subject for K7 students. They can learn it online and collaborate with their friends realtime to solve geographical problem they found in the game such as measuring distance from 1 point to another point.


The point of our research was how to use the game to be a effective tool to gain attention of the student to learn and also play on the same time with their peers and teacher.