That should be 'var' instead of 'int', sorry.
Regarding the balloon -- you can try this: create two different shapes for the balloon with the following characteristics:
Inflated balloon: it has a barge object (shape 961) created with edit->create barge, as well as several barge parts for the basket and bag. Since it is a barge it has 0 (infinite) weight and volume. Double-clicking the bag while on ground deflates it, double-clicking the basket (or maybe a heater) causes you to take off/land the balloon.
Deflated balloon: a single new shape of 'barge' type, but with finite weight and volume (possibly set high enough that it must be carried on the hands or in the backpack spot, but not inside a backpack or crate). Double-clicking inflates it for flight.
Inflation process: player puts deflated balloon on ground. and double-clicks it. In usecode, check flag 21 ('okay to land') of the deflated balloon with get_item_flag intrinsic to see if the deflated balloon object is on level ground with no obstructions. If it is, change the balloon to shape 961 and create (through usecode) all the barge pieces that make up the basket, the bag's support and the bag, possibly with some inflating animation. When double-clicking the balloon causes characters to go inside the basket and lifts the whole thing.
Deflation process: when landed, and the bag is double-clicked, check if there is anything inside the basket, and stop the process if so. Then, delete the barge parts that compose the balloon and change the barge's shape (the one with shape 961) to the deflated balloon's shape so it can be picked up.
Changing the shape is meant to keep the extra attached information, since both objects in question are of barge type.
Note: this is an idea. I have no idea if it will work, but I can see no reason why it wouldn't.
Bonus: if you want to implement wind, you can use static usecode variables to store wind direction (maybe changing it in a more continuous way) and speed (an idea would be the number of ticks between each wind step, or zero for no wind). When the balloon is inflated, you start the wind, and keep looping in the barge object like so:
Code: Select all
if (wind_speed)
{
script item after wind_speed ticks
{
step wind_direction; // 0-7, 0 = north, 7 = north-west
call BalloonWind;
}
}
else
{
script item
{
call BalloonWind;
}
}
Or something like that.