Author Topic: placeable or area creating objects?  (Read 309 times)

Legacy_Kossuths_Will

  • Newbie
  • *
  • Posts: 28
  • Karma: +0/-0
placeable or area creating objects?
« on: September 15, 2010, 03:17:09 am »


               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 ':?'
               
               

               
            

Legacy_kalbaern

  • Hero Member
  • *****
  • Posts: 1531
  • Karma: +0/-0
placeable or area creating objects?
« Reply #1 on: September 15, 2010, 03:44:57 am »


               How about posting the actual script.
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
placeable or area creating objects?
« Reply #2 on: September 15, 2010, 04:49:40 am »


               Double post
               
               

               


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


            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
placeable or area creating objects?
« Reply #3 on: September 15, 2010, 04:54:00 am »


               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 .
                     
                  


            

Legacy_Mudeye

  • Full Member
  • ***
  • Posts: 238
  • Karma: +0/-0
placeable or area creating objects?
« Reply #4 on: September 21, 2010, 07:43:14 pm »


               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?