|
|
WIP: Tutorial: "Making simple tS7 fighter game"
About Truespace Archives
These pages are a copy of the official truespace forums prior to their removal somewhere around 2011.
They are retained here for archive purposes only.
WIP: Tutorial: "Making simple tS7 fighter game" // Work in Progress
Post by Johny // Dec 20, 2006, 1:19am
|
Johny
Total Posts: 672
|
Coming soon!
Download exercise material at this link (http://forums1.caligari.com/truespace/attachment.php?attachmentid=3388&d=1165922417) |
Post by Johny // Dec 21, 2006, 5:05am
|
Johny
Total Posts: 672
|
After download exercise material and read file file 'akiko.htm', we can see that there're two animation set on exercise materials. One is adventure mode and other one is fighting mode. we need to ignore adventure animation set because we want to make simple fighting game.
Focus on DX7 fighting animation table:
animation set #2: fighting mode
48,59 - ready 1-12
60,62 - forward 1-3 (movement speed is 0.75 mt/sec)
63,65 - backward 1-3 (movement speed is 0.75 mt/sec)
66,67 - jump 1-2 (lift)
68,69 - jump 3-4 (fall)
70,71 - jump 5-6 (land)
72,76 - block 1-5
77,79 - punch 1-3
80,82 - kick 1-3
83,88 - special 1-6
89,94 - win 1-6
95,99 - loose 1-5
Where 48,59,60,...etc are akiko48.x, akiko59.x, akiko60.x, ...etc.
On above table we can see that animation for akiko on ready mode need 12 poses (from akiko48.x until akiko59.x).
First on model View, click on File-> Load-> Object for open file 'akiko48.x'. After open file 'akiko48.x', on LE we can see new object name readyMesh. Click on small orange triagle on readyMesh obj panel for bring us into readyMesh obj. We can see that there're 3 objects inside readyMesh obj: Shape, Transform, and Material. Rename Shape object become: 'F_ready1'. Then hold 'Ctrl' key and drag 'F_ready1' obj for save into objects library.
create new scene and repeat above step for file 'akiko49.x', 'akiko50.x',... until 'akiko59.x'. And rename shape obj inside it become F_ready2, F_ready3,...until F_ready12 then click and drag it into objects library.
After above step, now we have objects F_ready1, F_ready2, F_ready3, F_ready4,... F_ready12 inside objects library.
Next post, we will show you how I join them become animation. |
Post by Johny // Dec 22, 2006, 3:02am
|
Johny
Total Posts: 672
|
Before continue to next step, lets doing some experiment.
1. Create new scene.
2. on model view create a polyCube.
3. switch to player view.
4. on LE editor, click cube obj orange triagle for go inside it. (You can see that cube obj contain 3 objs (Shape, Material, and Transform).
5. Drag F_ready1 obj that we already create on post no #2 and put it inside cube obj.
6. Now connect link from F_ready1's Mesh out to Shape Input Mesh connector. You'll see on 3D player view that now Cube obj shape change become akiko shape.
From this experiment we can get conclusion that we can make animation by disconnect and connect from one shape to another shape continuous.
Ops, I can not upload Gif animation file :o (max size limit is 19.5 Kb at 620x280px) |
Post by Johny // Dec 23, 2006, 2:12am
|
Johny
Total Posts: 672
|
Now back to our main project.
Until This step, we all already have 12 shape objects (F_ready1 until F_ready12).
Follow below steps for continue our work:
1. create new scene.
2. From model view, import 'akiko59.x' (File-> load-> object -> DirectX *.X).
3. Open Material Editor and apply a texture map that come with akiko.
4. On LE view, rename readyMesh become F_Akiko.
5. Click orange triagle of F_Akiko obj for go inside it.
6. Drag 'F_ready1' shape obj until 'F_ready12' shape obj all put inside 'F_Akiko' Obj.
7. Click on System componet icon for open System Library.
8. On system library select scripts library and then drag jScript command obj and put it inside 'F_Akiko' obj too.
9. Rename 'jScript command' obj become 'ready_code'.
Now our link Editor shown as below image. And now we can manually connect F_ready??'s mesh output connector for Shape input connector and see change on 3D view.
Next step we'll write some jScript code for make and test Akiko's ready animation. |
Post by Johny // Dec 23, 2006, 5:48am
|
Johny
Total Posts: 672
|
Our jScript command function is send shape data from F_ready1 until F_ready12 to Shape one by one. So its need extra 12 inputs, 1 output, and 1 local variable.
follow below steps to continue:
1. Click on orange trangle of 'ready_code' panel to open script editor.
2. Defaultly script editor always open on Methods tab. Please click on Attributes tab for open attributes editor.
3. Click button 'Add attr'.
4. On add new attribute panel, type 'inMesh1' for Name, select IN for Direction, and Select Space 3D Package/Mesh Data for Type. then press Ok.
5. Repeat step 3 and step 4 for 'inMesh2' until 'inMesh12'.
6. do step 3, then On add new attribute panel, type 'outMesh' for Name, select OUT for Direction, and Select Space 3D Package/Mesh Data for Type. then press Ok.
7. do step 3, On add new attribute panel, type 'pos' for Name, set local flag, and select int for Type. then press Ok.
8. If all done well, your ready_code Attributes should be look like on below image.
9. Click on Methods tab for open code editor.
10. Replace all codes on there with below codes.
function Execute(params)
{
pos = params.ConValue('pos');
inMesh = new Array(12);
inMesh[0] = params.ConValue('inMesh1');
inMesh[1] = params.ConValue('inMesh2');
inMesh[2] = params.ConValue('inMesh3');
inMesh[3] = params.ConValue('inMesh4');
inMesh[4] = params.ConValue('inMesh5');
inMesh[5] = params.ConValue('inMesh6');
inMesh[6] = params.ConValue('inMesh7');
inMesh[7] = params.ConValue('inMesh8');
inMesh[8] = params.ConValue('inMesh9');
inMesh[9] = params.ConValue('inMesh10');
inMesh[10] = params.ConValue('inMesh11');
inMesh[11] = params.ConValue('inMesh12');
params.ConValue('outMesh')=inMesh[pos];
pos++;
if (pos>11) pos=0;
params.ConValue('pos')=pos;
ownernm = System.ThisOwner();
shape = ownernm.concat("/Shape")
me = ownernm.concat("/ready_code");
Node.DisconnectAll(shape,'Input Mesh');
Node.ConnectTo(me,'outMesh',shape,'Input Mesh');
}
11. Click on orange trangle at LE title bar for out from script editor.
12. Make connection from 'Mesh' of F_ready1 to 'inMesh1' of ready_code.
13. repeat step 12 for F_ready2 until F_ready12 connect to inMesh2 until inMesh12.
14. Now click 'Start' button of ready_code obj several times and see the change on 3D view.
Note: for unstop animation, we can drag Timer Event obj from Activity Libraries, then connect its control out to control in of ready_code obj. |
Post by Johny // Dec 24, 2006, 2:35am
|
Johny
Total Posts: 672
|
Now I try to give some explaination about our ready_code codes. (sorry if my bad English make it hard to understand)
function Execute(params)
{
pos = params.ConValue('pos'); // variable pos is use for save index for next inMesh data that we want to sent to outMesh
inMesh = new Array(12); // create array variable name inMesh with numbers of member equal to number of inMesh connector
// 12 here is number of inMesh connector
inMesh[0] = params.ConValue('inMesh1'); // get inMesh data from connector and save it on array
inMesh[1] = params.ConValue('inMesh2');
inMesh[2] = params.ConValue('inMesh3');
inMesh[3] = params.ConValue('inMesh4');
inMesh[4] = params.ConValue('inMesh5');
inMesh[5] = params.ConValue('inMesh6');
inMesh[6] = params.ConValue('inMesh7');
inMesh[7] = params.ConValue('inMesh8');
inMesh[8] = params.ConValue('inMesh9');
inMesh[9] = params.ConValue('inMesh10');
inMesh[10] = params.ConValue('inMesh11');
inMesh[11] = params.ConValue('inMesh12');
params.ConValue('outMesh')=inMesh[pos]; // sent next inMesh to outMesh
pos++; // add index counter
if (pos>11) pos=0; // 11 here is numbers of inMesh connector minus one
params.ConValue('pos')=pos; // save pos value to connector for use next call
ownernm = System.ThisOwner();
shape = ownernm.concat("/Shape")
me = ownernm.concat("/ready_code");
Node.DisconnectAll(shape,'Input Mesh'); // disconnet all link that connect to shape's 'Input Mesh' connector
Node.ConnectTo(me,'outMesh',shape,'Input Mesh');// connect link from me to shape's 'Input Mesh' connector
}Hope until this step you all can understand my tutorial and succesly to make animation for ready pose.
Dont worry if you not success. Here I attach akiko.RsObj file for compare and examine where the error come. Remember for your pratice instead of download this file, it's better if you first try to find where the error by yourseft. |
Post by Johny // Dec 25, 2006, 4:47am
|
Johny
Total Posts: 672
|
Repeat steps from post number #2 until post number #5 for other animation set (forward, backward, jump,block,punch,kick,special,win, and loose).
Here I attach Akiko obj with all animation set for reference. Go inside it and press test button or use Timer Event for test it one by one. |
Post by Johny // Dec 31, 2006, 9:17am
|
Johny
Total Posts: 672
|
-- empty for future use --- |
Post by Johny // Dec 31, 2006, 9:22am
|
Johny
Total Posts: 672
|
Now you can download finish and playable game at below link.:D
Because of my bad English and it's hard for me to explaination the script making all one by one:o, so I open this thread for Q&A. Please feel free let me know if you have any question.:rolleyes: |
Post by trueBlue // Dec 31, 2006, 10:18am
|
trueBlue
Total Posts: 1761
|
You are truely amazing Johny!:jumpy:
I noticed right off on your online link that you need to delete this portion off your command: http://
Thanks Johny! |
Post by Johny // Jan 1, 2007, 12:48am
|
Johny
Total Posts: 672
|
You are truely amazing Johny!:jumpy:
I noticed right off on your online link that you need to delete this portion off your command: http://
Thanks Johny!
Thanks trueBlue :rolleyes:. here an update. just remove http:// on online button's properties and add rcd file for truePlay 1.21 user.
I keep the early file for compare. if someone want learn what change beetween early version and version of this post; go to edit panel and open properties for online button.
<edit>
Here an update again. Fix some error on Player2 forward move, add forget code for block action and fix random collision fail problem.
</edit> |
Post by Johny // Jan 2, 2007, 3:27am
|
Johny
Total Posts: 672
|
trueBlue emailed me his modification of this game. He add Camera views from each player, changed scene Camera1 to EntryCamera, background color, grid, and make nice game Panel.
And because his version are modification from old version (not fixed version), I add some fix code as at before post, and here is the New version of our colabaration of tS7 Fighting Game.
PS: Download RsScn file if you wish to open it with tS7.11, and download rcd file if you want to open it with truePlayer1.21.
As usual I dont delete old game version for reference if someone want to learn and compare the making progress. |
Post by peterma // Jan 3, 2007, 1:05am
|
peterma
Total Posts: 48
|
Looks just great, i have to betatest it asap :) |
Post by Johny // Jan 3, 2007, 1:42am
|
Johny
Total Posts: 672
|
Peterma thanks for support. How about to add network's opponent so in future we can fight on truePlace. :) |
|