Aller au contenu

Photo

exchange of one placeable for another


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

#1
gordonbrown82

gordonbrown82
  • Members
  • 544 messages
i have four levers that can be broken by the enemy. if the enemy breaks the levers i would like them to be replaced by lever placeables that are lying down.

#2
edmogt1

edmogt1
  • Members
  • 52 messages
Create a custom placeable event script and for the  EVENT_TYPE_DEATH event

add a CreateObject function call

Posted ImagePosted Image

#3
gordonbrown82

gordonbrown82
  • Members
  • 544 messages
the problem with createobject is that i need the broken levers to be lying down on the ground.

#4
gordonbrown82

gordonbrown82
  • Members
  • 544 messages
is there some placeable property i can set so i can place both placeables in the same place and then make one invisible while the other is visible?

#5
gordonbrown82

gordonbrown82
  • Members
  • 544 messages
or can i set the orientation of the broken levers through some function?

#6
gordonbrown82

gordonbrown82
  • Members
  • 544 messages
i tried this code but i got a lever that was standing up being oriented another way instead of a lever lying down.

vector vLeverOrientation = StringToVector("-0,0,76.698");

location lLeverSpawn1 = GetLocation(GetObjectByTag("wp_broken_lever1"));





CreateObject(512, R"broken_lever_cave2.utp", lLeverSpawn1);

SetOrientation(GetObjectByTag("broken_lever_cave2"), vLeverOrientation);

#7
FollowTheGourd

FollowTheGourd
  • Members
  • 572 messages
Maybe try using the "active" property and have both in your level at the same time.

Modifié par FollowTheGourd, 25 juillet 2010 - 05:28 .


#8
gordonbrown82

gordonbrown82
  • Members
  • 544 messages
how do i set that?

#9
FollowTheGourd

FollowTheGourd
  • Members
  • 572 messages
In the toolset's object inspector and (WR_)SetObjectActive().

Modifié par FollowTheGourd, 25 juillet 2010 - 05:57 .


#10
gordonbrown82

gordonbrown82
  • Members
  • 544 messages
ok thanks.

#11
FergusM

FergusM
  • Members
  • 460 messages

gordonbrown82 wrote...

i tried this code but i got a lever that was standing up being oriented another way instead of a lever lying down.
vector vLeverOrientation = StringToVector("-0,0,76.698");
location lLeverSpawn1 = GetLocation(GetObjectByTag("wp_broken_lever1"));


That's because you're modifying the z rotation, which is basically the facing. If you want to turn the object on its side, you'll have to play with the first two parameters instead e.g. (90,0,0). I'm not sure if you can actually change the x or y rotation of a placeable; I should think so, but I know you can't really do it for creatures.

#12
Craig Graff

Craig Graff
  • Members
  • 608 messages
Rotation about the x and y axes only works in the toolset, not at run time.