4 random triggers,and a pawn as a pickup .
Posted: Sun Aug 17, 2008 4:23 pm
1.Lets say you have a chest and when it opens it sets a trigger on before fading out.
It chooses randomly one from four triggers.
example:Trigger1 is fireball,2 for treasure,3 for health potion,4 is for dart trap.
I have the chest script but i dont know what to add in for the triggers event.
The "Open" order is the part in which i want to add the 4 random triggers instead of the
SetEventState command.
{
Spawn[ ()
{
Console(false);
BoxWidth(44); // set bounding box width/depth
AttributeOrder("health", 20, "Open");
} ]
Wait[ ()
{
PlaySound("");
} ]
Open[ ()
{
AnimateStop("Open","2","creak1.wav");
SetEventState("Chest1Trigger", true);
SetNoCollision();
FadeOut(1,0);
Remove(true);
} ]
}
2. And i would like to ask if you want a pawn to spawn an attribute item next to it when it gets destroyed:
I guess there is no way to spawn the attribute entity near the point each pawn was killed.
So the way must be propably a pawn that will act as the gold,which will be positioned next to the dying pawn some texels up on the air-with gravity on,to seem like it has fallen from the pawn.
I will not use this script yet,but i wanted to know if its going to work anyway.
Few years ago i had trouble switching between high and lowlevel orders,as i often got messages in the debug console like-
Unknown method:lowlevel..etc.
----Monsters Gold script----
{
Spawn[ ()
{
Console(false);
BoxWidth(44); // set bounding box width/depth
Gravity("true");
LowLevel("Position");
} ]
Position[ ()
{
PositionToPawn("Grunt_44", 0, 0, 12, false);
HighLevel("Wait");
} ]
Wait[ ()
{
AddCollisionOrder("Givegold");
PlayAnimation("Rotate", "false", "");
RestartOrder();
} ]
Givegold[ ()
{
ModifyAttribute("gold", 100, "Player");
DelCollisionOrder();
Remove(true);
} ]
}
A detail:Is there a way to loop the animation of the wait order without using restart order?
And,do i have to use DelCollisionOrder at the end?
It chooses randomly one from four triggers.
example:Trigger1 is fireball,2 for treasure,3 for health potion,4 is for dart trap.
I have the chest script but i dont know what to add in for the triggers event.
The "Open" order is the part in which i want to add the 4 random triggers instead of the
SetEventState command.
{
Spawn[ ()
{
Console(false);
BoxWidth(44); // set bounding box width/depth
AttributeOrder("health", 20, "Open");
} ]
Wait[ ()
{
PlaySound("");
} ]
Open[ ()
{
AnimateStop("Open","2","creak1.wav");
SetEventState("Chest1Trigger", true);
SetNoCollision();
FadeOut(1,0);
Remove(true);
} ]
}
2. And i would like to ask if you want a pawn to spawn an attribute item next to it when it gets destroyed:
I guess there is no way to spawn the attribute entity near the point each pawn was killed.
So the way must be propably a pawn that will act as the gold,which will be positioned next to the dying pawn some texels up on the air-with gravity on,to seem like it has fallen from the pawn.
I will not use this script yet,but i wanted to know if its going to work anyway.
Few years ago i had trouble switching between high and lowlevel orders,as i often got messages in the debug console like-
Unknown method:lowlevel..etc.
----Monsters Gold script----
{
Spawn[ ()
{
Console(false);
BoxWidth(44); // set bounding box width/depth
Gravity("true");
LowLevel("Position");
} ]
Position[ ()
{
PositionToPawn("Grunt_44", 0, 0, 12, false);
HighLevel("Wait");
} ]
Wait[ ()
{
AddCollisionOrder("Givegold");
PlayAnimation("Rotate", "false", "");
RestartOrder();
} ]
Givegold[ ()
{
ModifyAttribute("gold", 100, "Player");
DelCollisionOrder();
Remove(true);
} ]
}
A detail:Is there a way to loop the animation of the wait order without using restart order?
And,do i have to use DelCollisionOrder at the end?