Dynamic fields and connection...
by Eros · in Torque Game Engine Advanced · 10/20/2009 (9:07 am) · 5 replies
I'm having two problems to make a little demo game..
First, i'm trying to define an item object with some dynamic fields to work as checkpoint, i use this code:
%obj = new Item() {
position = "798.686 1208.03 234.76";
rotation = "1 0 0 0";
scale = "9 15 50";
collidable = "0";
dataBlock = Checkpoint;
static = true;
rotate = false;
};
%obj.ag="try1";
if i enter the world editor inspector, and select the item, i can see the value perfectly setted on dynamic fields but, if i try to get it from the onCollision item fuction (echo(%this.ag)), it returns nothing... ¿Can anyone tell me what happens?
The other problem occurs on connection. I've divided the code in two diferent games, game & client. I have both programs on diferent computers and i can play with two or more clients without any problem connecting thru a no-ip redirection but, if i compile the client and delete the cs files to have a demo of the game, the client try to connect, the server get the pettition and then it all comes down and the client suggest to look for another server. I cant get the error right now cause i'm rebuilding the project (once more.. xD), if you need more info, i'll paste it later.
Another extra question. ¿Is there any way to transform directly a world created in maya as the ground for a miss?
Thank you
First, i'm trying to define an item object with some dynamic fields to work as checkpoint, i use this code:
%obj = new Item() {
position = "798.686 1208.03 234.76";
rotation = "1 0 0 0";
scale = "9 15 50";
collidable = "0";
dataBlock = Checkpoint;
static = true;
rotate = false;
};
%obj.ag="try1";
if i enter the world editor inspector, and select the item, i can see the value perfectly setted on dynamic fields but, if i try to get it from the onCollision item fuction (echo(%this.ag)), it returns nothing... ¿Can anyone tell me what happens?
The other problem occurs on connection. I've divided the code in two diferent games, game & client. I have both programs on diferent computers and i can play with two or more clients without any problem connecting thru a no-ip redirection but, if i compile the client and delete the cs files to have a demo of the game, the client try to connect, the server get the pettition and then it all comes down and the client suggest to look for another server. I cant get the error right now cause i'm rebuilding the project (once more.. xD), if you need more info, i'll paste it later.
Another extra question. ¿Is there any way to transform directly a world created in maya as the ground for a miss?
Thank you
#2
10/20/2009 (10:14 am)
Quote:echo(%this.ag)In functions such as onCollision, %this refers to the datablock. Try echoing %obj.ag instead.
Quote:¿Is there any way to transform directly a world created in maya as the ground for a miss?You want to make a level or object in Maya and be able to walk on it? Try ticking the 'polySoup' field in the editor, that should allow you to collide with its visible geometry. I'm not sure about the details of working with Maya, though.
#3
Thank you very much
about the second answer, it will be a dts, but i want it to be the miss base ground.
10/20/2009 (10:33 am)
wo, that works, i thought on %this as the object itself but this makes sense xDThank you very much
about the second answer, it will be a dts, but i want it to be the miss base ground.
#4
10/20/2009 (10:55 am)
Many methods, like onCollision, are defined and called on the datablock itself. So %this is always the object the function is being called on... just sometimes, that object is a datablock.
#5
I've created a new project with the bat in the TGEA 181, i've done some scripts modifications and commented the define no_dso line... then i do compile the project and it stop working. everytime i pass the mouse over a button control, the project breaks with a windows error. Even if i open the gui editor and try to open the palette, when i put the mouse over the togle button, it crashes.
anyone knwos why could this be happening?
10/21/2009 (8:53 am)
Still having the last prblem i commented.I've created a new project with the bat in the TGEA 181, i've done some scripts modifications and commented the define no_dso line... then i do compile the project and it stop working. everytime i pass the mouse over a button control, the project breaks with a windows error. Even if i open the gui editor and try to open the palette, when i put the mouse over the togle button, it crashes.
anyone knwos why could this be happening?
Torque Owner Eros