I added in the Pawn.ini a Pawn called Breakable that has no mesh and some accessory actors to to choose from the Pawn.ini list and attach as display actors ,like vase1,vase2 and so on.
Then gets replaced with the wrecked version and reduces the bounding box height (maybe the width a little too) (the vases are smaller broken)
I have dozen vases on the works ,few are ready and thought to start with some of them and later i could add more vase types in the script.
I have a crate done but i think it could use a modified version of a generic breakables script if i have it.
The Orders for all pickups are same,changing only base vase ,attribute accessories,bounding box for starting and broken vase version bound and names.
With some basic variables added i imagine it could get much shorter and i hope simple enough.
Right now the script is kind of huge ,full of all those Orders.
I would like it to have a function to display something like "you found" and stick on it a "small bread" at the end the " from the attribute or accessory list
Also maybe have the option at start of script for a number that sets the chance for spawning at all or not, being empty or with loot,.
So far i thought to have various spawn orders and pick one of them in the level editor in any case i wanted a vase to spawn for sure.
Simple old classic stuff: ammo is projectile attributes
Food is stamina attribute increase
Drink is Health restore for red potion and mana fill for blue potion,Water and mead is stamina refill.
I do not think i finished the script anyway and i might have mixed or forgot some attribute order,so i did not bother testing,nor i have exported the accessory attribute actors yet.
About Text: I switched to low level to display a text that says what you found but i could not make it delay before disappearing -it needs fixing.
If you can,roughly align the text at above center and to the left,i use isometric view,player is almost at center and maybe text should stay clear from him.
I am not certain yet about few minor things,and i might change minor things like the distance the text appears and maybe add more pickups some day.
I mean if the text appears when the vase breaks no matter how far you are and again if you get close.
I imagine if there are dozens of vases in rows and you break them it would be a mess to say what each of them.
If a small text would be displayed above the broken vase it would not be seen in small screens,unless you press and hold at for examine in 1st person view.
Scroll down and take your time to have a look at it.I am not hurrying because i do not have the attributes actors and most vases finished and exported yet.
Orders i thought to use-just to see what i thought to do
basic orders-
Spawn (general)
SpawnOrNot
NotSpawn
VaseRandomSpawn
Vase_Ceramic_1_Spawn (can i use that _ in the orders names or not -i wonder)
Idle
Destroyed
LootOrNot
Empty
RandomLoot
--What type of attribute you found--
Ammo
Food
PotionOrDrink
Potion
Drink
Bread
Meat
Fruit
(show description text )
ThrowingDagger ...and rest attributes in list
finally--ending the script while giving the pickup upon collision
MeadFlaskWait
and so on,for the rest pickups,i did not fill it up for all attributes since the script is temporary.
Code: Select all
{
Spawn[ ()
{
Console(false);
Gravity(true);
NewOrder("SpawnOrNot");
} ]
SpawnOrNot[ ()
{
// "Roll" random chance for Spawning the breakable or not
switch(random(0,2))
{
case 0
{
NewOrder("NotSpawn");
}
case 1
{
NewOrder("VaseRandomSpawn");
}
case 3
{
NewOrder("VaseRandomSpawn");
}
} ]
NotSpawn[ ()
{
// nothing inside so,finish the script
EndScript();
}
} ]
VaseRandomSpawn[ ()
{
switch(random(0,4))
{
case 0
{
NewOrder("Vase_Ceramic_1_Spawn");
}
case 1
{
NewOrder("Vase_Ceramic_2_Spawn");
}
case 2
{
NewOrder("Vase_Wooden_1_Spawn");
}
case 3
{
SetEventState("VaseWooden1",true);
}
case 4
{
SetEventState("trigger1",true);
}
} ]
Vase_Ceramic_1_Spawn[ ()
{
Console(false);
Gravity(true);
BoxWidth(20);
BoxHeight(33);
AttachAccessory("Vase_Ceramic_1");
NewOrder("Idle");
} ]
Idle[ ()
{
AttributeOrder("enemy_health", 1, "Destroyed");
} ]
Destroyed[ ()
{
BoxHeight(16);
DetachAccessory("Vase_Ceramic_1");
AttachAccessory("Vase_Ceramic_1_broken");
AddExplosion("Vase_Ceramic_1_Explosion", "BONE02", 0, 0, 0);
NewOrder("LootOrNot");
} ]
LootOrNot[ ()
{
switch(random(0,1))
{
case 0
{
NewOrder("Empty");
}
case 1
{
NewOrder("RandomLoot");
}
} ]
}
Empty[ ()
{
EndScript();
}
} ]
RandomLoot[ ()
{
switch(random(0,3))
{
case 0
{
NewOrder("Ammo");
}
case 1
{
NewOrder("Food");
}
case 2
{
NewOrder("PotionOrDrink");
}
} ]
Ammo[ ()
{
switch(random(0,5))
{
case 0
{
AttachAccessory("");
NewOrder("ThrowingDagger");
}
case 1
{
AttachAccessory("ThrowingHammer");
NewOrder("ThrowingHammer");
}
case 3
{
AttachAccessory("ThrowingAxe");
NewOrder("ThrowingAxe");
case 3
{
AttachAccessory("Arrow");
NewOrder("Arrow");
case 4
{
AttachAccessory("Bomb");
NewOrder("Bomb");
}
} ]
Food[ ()
{
switch(random(0,4))
{
case 0
{
NewOrder("Bread");
}
case 1
{
NewOrder("Meat");
}
case 3
{
NewOrder("Fruit");
}
} ]
PotionOrDrink[ ()
{
switch(random(0,2))
{
case 0
{
NewOrder("Potion");
}
case 1
{
NewOrder("Drink");
}
} ]
Potion[ ()
// "Roll" for random Potion type
{
switch(random(0,4))
{
case 0
{
AttachAccessory("Potion_Red");
NewOrder("PotionOfMinorHealing");
}
case 1
{
AttachAccessory("Potion_Red");
NewOrder("PotionOfHealing");
}
case 2
}
AttachAccessory("Potion_Blue");
NewOrder("PotionOfMinorMana");
{
case 2
}
AttachAccessory("Potion_Blue");
NewOrder("PotionOfMana");
{
} ]
Drink[ ()
// "Roll" for random Drink type
{
switch(random(0,2))
{
case 0
{
AttachAccessory("LeatherFlask");
NewOrder("FlaskOfWater");
}
case 1
{
AttachAccessory("LeatherFlask");
NewOrder("FlaskOfMead");
}
} ]
Bread[ ()
{
switch(random(0,2))
{
case 0
{
AttachAccessory("Breadsmall");
PlayerDistOrder(64, "Breadsmall");
}
case 1
{
AttachAccessory("BreadBig");
PlayerDistOrder(64, "BreadBig");
}
} ]
Meat[ ()
{
switch(random(0,2))
{
case 0
{
AttachAccessory("Ham1");
PlayerDistOrder(64, "Ham");
}
case 1
{
AttachAccessory("HamBig");
PlayerDistOrder(64, "HamBig");
}
} ]
Fruit[ ()
{
switch(random(0,2))
{
case 0
{
AttachAccessory("AppleRed");
PlayerDistOrder(64, "Apple");
}
case 1
{
AttachAccessory("AppleGreen");
PlayerDistOrder(64, "Apple");
}
} ]
ThrowingDagger[ ()
{
// Show Decription Text of what you have found
DrawText("Throwing Dagger", 500, 500, 255, 3, 255, 255, 255);
RemoveText("Throwing Dagger");
HighLevel("ThrowingDaggerWait");
}
} ]
ThrowingHammer[ ()
{
DrawText("Throwing Hammer", 500, 500, 255, 3, 255, 255, 255);
RemoveText("Throwing Hammer");
HighLevel("ThrowingHammerWait");
}
} ]
ThrowingAxe[ ()
{
DrawText("Throwing Axe", 500, 500, 255, 3, 255, 255, 255);
RemoveText("Throwing Axe");
HighLevel("ThrowingAxeWait");
}
} ]
Arrow[ ()
{
DrawText("Arrow", 500, 500, 255, 3, 255, 255, 255);
RemoveText("Arrow");
HighLevel("ArrowWait");
}
} ]
Bomb[ ()
{
DrawText("Bomb", 500, 500, 255, 3, 255, 255, 255);
RemoveText("Bomb");
HighLevel("BombWait");
}
} ]
Breadsmall[ ()
{
DrawText("a Small Bread", 500, 500, 255, 3, 255, 255, 255);
RemoveText("a Small Bread");
HighLevel("SmallBreadWait");
}
} ]
BreadBig[ ()
{
DrawText("BreadBig", 500, 500, 255, 3, 255, 255, 255);
RemoveText("BreadBig");
HighLevel("BreadBigWait");
}
} ]
Ham[ ()
{
DrawText("Ham", 500, 500, 255, 3, 255, 255, 255);
RemoveText("Ham");
HighLevel("HamWait");
}
} ]
HamBig[ ()
{
DrawText("HamBig", 500, 500, 255, 3, 255, 255, 255);
RemoveText("HamBig");
HighLevel("HamBigWait");
}
} ]
AppleRed[ ()
{
DrawText("Red Apple", 500, 500, 255, 3, 255, 255, 255);
RemoveText("Red Apple");
HighLevel("AppleRedWait");
}
} ]
AppleGreen[ ()
{
DrawText("Green Apple", 500, 500, 255, 3, 255, 255, 255);
RemoveText("Green Apple");
HighLevel("AppleGreenWait");
}
} ]
PotionOfMinorHealing[ ()
{
DrawText("Potion of Minor Healing", 500, 500, 255, 3, 255, 255, 255);
RemoveText("Potion of Minor Healing");
HighLevel("PotionOfMinorHealingWait");
}
} ]
PotionOfHealing[ ()
{
DrawText("Potion of Healing", 500, 500, 255, 3, 255, 255, 255);
RemoveText("Potion of Healing");
HighLevel("PotionOfHealingWait");
}
} ]
PotionOfMinorMana[ ()
{
DrawText("Potion of Minor Mana", 500, 500, 255, 3, 255, 255, 255);
RemoveText("Potion of Minor Mana");
HighLevel("PotionOfMinorManaWait");
}
} ]
PotionOfMana[ ()
{
DrawText("Potion of Mana", 500, 500, 255, 3, 255, 255, 255);
RemoveText("Potion of Mana");
HighLevel("PotionOfManaWait");
}
} ]
WaterFlask[ ()
{
DrawText("Flask of Water", 500, 500, 255, 3, 255, 255, 255);
RemoveText("Flask of Water");
HighLevel("FlaskOfWaterWait");
}
} ]
MeadFlask[ ()
{
DrawText("Flask of Mead", 500, 500, 255, 3, 255, 255, 255);
RemoveText("Flask of Mead");
HighLevel("FlaskOfMeadWait");
}
} ]
MeadFlaskWait[ ()
{
// Increase Attribute -all the rest pickups above have same Order with this
AddCollisionOrder("FlaskOfWaterModify")
DetachAccessory("LeatherFlask");
ModifyAttribute("MeadFlask", 1);
EndScript();
}
} ]