Aller au contenu

Photo

placeable or area creating objects?


  • Veuillez vous connecter pour répondre
4 réponses à ce sujet

#1
Kossuths_Will

Kossuths_Will
  • Members
  • 14 messages
I have a script that tells a placeable to execute a script, within which it has CreateObject. I have debugged it, and the variables are being called correctly, but for some reason it refuses to create the creatures. So I instead tried substituting the plain CreateObject part with AssignCommand, as follows:

AssignCommand(oObject, CreateObject(OBJECT_TYPE_CREATURE, "eots_fish2", lRE)); 

this gave me 'doesnt match parameters', which I thought was a little odd, but i figured it was because AssignCommand only works with actions, so then I changed it to:

AssignCommand(oObject, ActionDoCommand(CreateObject(OBJECT_TYPE_CREATURE, "eots_fish2", lRE)));

still no dice. what am I missing here? it's probably something simple that i'm just not thinking of but its getting annoying :?

#2
kalbaern

kalbaern
  • Members
  • 824 messages
How about posting the actual script.

#3
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages
Double post

Modifié par Lightfoot8, 15 septembre 2010 - 03:57 .


#4
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages
The problem you are having is that the CreateObject function returns an object
The action functions are functions that do not return anything (void)
So what you are doing is entering a object as a paramater that is asking for a action
the way around this is to create a wrapper around the object to turn it into an action/void returning function. 

At the top of your script before the void main place this. 
action VoidObject( object oObject) {}

you will then be able to rewrite your line like this. 
AssignCommand(oObject, VoidObject(CreateObject(OBJECT_TYPE_CREATURE, "eots_fish2", lRE)));
I do not think this is your problem however.  You should not have to assign the command to an object to get it to work. 
It would be best if you posted you script.

Modifié par Lightfoot8, 15 septembre 2010 - 03:55 .


#5
Mudeye

Mudeye
  • Members
  • 126 messages
Why assign a command at all, why not just have the first script create the object?



CreateObject(OBJECT_TYPE_CREATURE, "eots_fish2", lRE);



What would be the reason in having something other than the first script create the object?