Nice work. I don't think I'll use brackets for the methods and I never have an issue with entity attributes but generally speaking it's a good guide.
I've experimented with my styles recently and find myself yes thinking about what other people will prefer but also what seems more readable to myself, which is ultimately more important in a way as I'm making them. I guess it's a subtle balance that is hard to be perfect.
I also changed up my practices recently to see what is better. For example, what opinions do you guys have on deleting threads you no longer need as opposed to using global scope flags? In my first test_bocage map I had many level.flags["something"] variables for this purpose, but in the current map I'm scripting I'm leaning more towards declaring the thread and killing it when no longer needed...
e.g.
Code:
//---------------------------------------------------------------//
// Mocking gunfire //
//---------------------------------------------------------------//
MockMGFire:
level.mockFireThread = local
wait 3
for (local.i = 1; local.i <= 4; local.i++) // *!* send out four bursts to mock player
{
local.randomint = randomint (29) + 1
if (local.randomint <= 10) // *!* pick corpse
{
$mg42_nest setAimTarget $mgtarget[1]
}
else if (local.randomint <= 20 && local.randomint > 10)
{
$mg42_nest setAimTarget $mgtarget[2]
}
else
{
$mg42_nest setAimTarget $mgtarget[3]
}
wait .1
$mg42_nest startFiring
//$mg42_nest.isFiring = 1
wait (randomfloat (3) + 1)
$mg42_nest stopFiring
//$mg42_nest.isFiring = 0
wait (randomfloat (2) + 1)
}
end
So, you can then stop the instructions immediately by:
Code:
if (level.mockFireThread)
level.mockFireThread delete
Instead of using flags and if statements in several locations in your method. Obviously it isn't for every situation, but I find it neater.
Oh, and about the global scripts, I find Mackey McCandlish's code the most untidy, especially in his SP level scripts. But I believe it was hastily done in places so I can't fault them too much. Steve Fukuda and Benson Russell scripts are usually better, but I think they scripted a lot of the original E3 stuff so had more time on those levels.
P.S. you used 'rabbit' instead of 'habit' in one place which made me giggle