Aller au contenu

Photo

[HELP] SetCanUseItem


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

#1
NewYears1978

NewYears1978
  • Members
  • 894 messages
I am messing around learning the toolset and scripting commands etc...I have placed some items (containers) using CreateObject.  They are openable, which I did not want so I found "SetCanUseitem"

On my first item here, I set this, and it worked.  

            location lCrate4Location = Location(oArea, Vector(159.425,129.433,0.0), 122.0);
            object oCrate4 = CreateObject(OBJECT_TYPE_PLACEABLE, R"genip_crate_wd_large_stat.utp", lCrate4Location);
            SetCanUseItem ( oCrate4, FALSE );

Then I tried to use it on a different item below, and it does not work...any idea why?

            location lBag2Location = Location(oArea, Vector(159.707,131.31,0.0239827), 0.0);
            object oBag2 = CreateObject(OBJECT_TYPE_PLACEABLE, R"genip_sack_small.utp", lBag2Location);
            SetCanUseItem ( oBag2, FALSE );

Modifié par NewYears1978, 21 novembre 2009 - 03:25 .


#2
NewYears1978

NewYears1978
  • Members
  • 894 messages
Okay update, I was wrong,the crate I used is by default not usable, there is another crate that is usable.



So a new question..does SetCanUseItem not work as I am trying to use it..and is there another way to flag something as not usable (keep in mind I am placing with CreateObject not placing in a new area where I could just change the flags)..



Or would I need to create a new placeable and set it as non-interactive or something?

#3
NewYears1978

NewYears1978
  • Members
  • 894 messages
Okay, I figured it out, sorry for the wasted posts. I had just overlooked the command..SetObjectInteractive.. =)

#4
Axe_Murderer

Axe_Murderer
  • Members
  • 279 messages
SetCanUseItem is for items not placeables. Likewise, SetObjectInteractive is for placeables not items.

Modifié par Axe_Murderer, 21 novembre 2009 - 07:39 .


#5
NewYears1978

NewYears1978
  • Members
  • 894 messages
I figured this one out earlier..SetObjectInterative instead