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.
exchange of one placeable for another
Débuté par
gordonbrown82
, juil. 24 2010 10:55
#1
Posté 24 juillet 2010 - 10:55
#2
Posté 24 juillet 2010 - 11:17
Create a custom placeable event script and for the EVENT_TYPE_DEATH event
add a CreateObject function call

add a CreateObject function call

#3
Posté 25 juillet 2010 - 03:21
the problem with createobject is that i need the broken levers to be lying down on the ground.
#4
Posté 25 juillet 2010 - 03:27
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
Posté 25 juillet 2010 - 03:28
or can i set the orientation of the broken levers through some function?
#6
Posté 25 juillet 2010 - 04:50
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);
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
Posté 25 juillet 2010 - 05:27
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
Posté 25 juillet 2010 - 05:43
how do i set that?
#9
Posté 25 juillet 2010 - 05:57
In the toolset's object inspector and (WR_)SetObjectActive().
Modifié par FollowTheGourd, 25 juillet 2010 - 05:57 .
#10
Posté 25 juillet 2010 - 06:41
ok thanks.
#11
Posté 25 juillet 2010 - 09:52
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
Posté 26 juillet 2010 - 01:25
Rotation about the x and y axes only works in the toolset, not at run time.





Retour en haut






