Jump to content

Tutorial Coin Collector: Could not find data block "CoinNode"


xetra11
 Share

Recommended Posts

I'm going through the Coin Collector Tutorial Project and it went pretty fluent until some issue I come over now.

The tutorial tells me to add the following code within the collision callback to spawn an emitter-node


Coins.cs:

function Coin::onCollision(%this, %obj, %col, %vec, %len)
{
%emitterNode = new ParticleEmitterNode(){
datablock = CoinNode;
emitter = CoinEmitter;
position = %obj.getPosition();
};
%obj.delete();

$CoinsFound++;
if(Coins.getCount() <= 0)
{
commandToClient(%col.client,'ShowVictory',$CoinsF[/code]
ound); } }

 

CoinDataBlock.cs:

 

datablock ParticleData(CoinParticle : DefaultParticle){
   lifetimeMS = 1000;
   gravityCoefficient = 0;
   dragCoefficient = "2";
 
   sizes[0] = 1;
   sizes[1] = 1;
   sizes[2] = 1;
   sizes[3] = 1;
   inheritedVelFactor = "0";
};
 
datablock ParticleEmitterData(CoinEmitter : DefaultEmitter){
   particles = CoinParticle;
   ejectionPeriodMS = "10";
   ejectionVelocity = "4.167";
   ejectionOffset = "0.625";
   thetaMax = "360";
   softnessDistance = "1";
   lifetimeMS = "200";
};
 
datablock ParticleEmitterNodeData(CoinNode : DefaultEmitterNodeData){
  timeMultiple = 1.0;
};

 

Following error occurs now when I run into a "Coin":

GameBase::setDatablockProperty - Could not find data block "CoinNode"

 

Does anyone know what typo or semantically wrong situation I have here?



Thanks in advance!

Link to comment
Share on other sites

So at the top there, I found:

ParticleEmitterData - CoinEmitter(10) - invalid value for thetaMax: Must be between 0 and 180

core/art/datablocks/CoinDatablock.cs (0): Unable to find parent object DefaultEmitterNodeData for ParticleEmitterNodeData.


Which means that, since you set thetaMax to "360" and that failed, the creation of the whole datablock failed, try setting it to "180". :D


Edit:

I can see it is a big in the tutorial, my bad!

Link to comment
Share on other sites

I changed that to 180 as I read the log by myself - I really need to read logs more frequently ^^


But I cannot fix that bug:


core/art/datablocks/CoinDatablock.cs (0): Unable to find parent object DefaultEmitterNodeData for ParticleEmitterNodeData.


Because its what the tutorial tells me - I don't know what to replace it with then, even autocomplete in torsion tell me to use DefaultEmitterNodeData

Link to comment
Share on other sites

Ohhh right, some templates don't have that datablock, because it is sort of redundant. You can either leave out the ": DefaultParticleEmitterNodeData" part, or define it somewhere, it shouldn't change the outcome! I have to clear that up in the tutorial.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...