Player Reading the wrong datablock?
by Jon Law · in Torque Game Engine · 01/17/2006 (4:05 pm) · 4 replies
Hi,
So.. I added my own play model/scripts/etc. but the script i used is Basically i copy of the original orc script. however i changed the orc datablock to "orcbody" so that i could refrence them differently.. However my player model is still reading the orcs .cs script. when i changed the function onEnterMissionArea, nothing happens unless i change it in the orc script. Also i changed the footprint file for my character but it is still reading the orc file so it points to the orcs footprint file.. basically what im asking is how do i change the orc so that it wont be refrenced by the player....
does that make sense??....
AHH help
thanks
So.. I added my own play model/scripts/etc. but the script i used is Basically i copy of the original orc script. however i changed the orc datablock to "orcbody" so that i could refrence them differently.. However my player model is still reading the orcs .cs script. when i changed the function onEnterMissionArea, nothing happens unless i change it in the orc script. Also i changed the footprint file for my character but it is still reading the orc file so it points to the orcs footprint file.. basically what im asking is how do i change the orc so that it wont be refrenced by the player....
does that make sense??....
AHH help
thanks
About the author
#2
Basically, when you create your player, you at that time define what datablock he should be using. If you want him to use your new (different) one, then you'll need to change the datablock value accordingly.
01/19/2006 (5:17 pm)
It would help a lot more to have some examples of your changes, as well as where you create your player in script.Basically, when you create your player, you at that time define what datablock he should be using. If you want him to use your new (different) one, then you'll need to change the datablock value accordingly.
#3
Notice the "dataBlock = orc;" bit; that is producing your avatar as the Orc shape via the 'default' datablock. You will probably want to change the reference from the "orc" datablock to your "orcbody", the newly created datablock that you did set up, per your example.
I agree with Stephan, in that seeing what your code is doing by exposing it will help greatly and speed up any help available. Sounds like you're pretty close to seeing your custom player.
This change will 'probably' be in the function GameConnection::createPlayer code of the script "game.cs"....not sure where you are creating your player.
01/20/2006 (7:37 am)
Sounds indeed like the instance of the 'new' player object is using the original dataBlock assignment. For example[really stretching myself now...]; whatever spawning function you're using to create your player "probably" contains a statement, like below, that references the shape, such as:{
%player = [b]new[/b] Player() {
dataBlock = orc; //or whatever your codeBase is referencing, your example above is using "orc"
assignment statement1;
assignment statement2;
}Notice the "dataBlock = orc;" bit; that is producing your avatar as the Orc shape via the 'default' datablock. You will probably want to change the reference from the "orc" datablock to your "orcbody", the newly created datablock that you did set up, per your example.
I agree with Stephan, in that seeing what your code is doing by exposing it will help greatly and speed up any help available. Sounds like you're pretty close to seeing your custom player.
This change will 'probably' be in the function GameConnection::createPlayer code of the script "game.cs"....not sure where you are creating your player.
#4
01/20/2006 (11:44 pm)
I figured it out.. it wasnt the player datablock.. it was the datablocks that the player datablock was reffering too.. thats why the footprints didnt change.. because my player datablock was refering to the original footprint datablock
Torque Owner Jon Law