Set / Get MAX_TURNRATE, Stop-Script, WeaponLockout
Posted: 04 Jun 2007, 09:31
Set / Get MAX_TURNRATE is the easiest to explain, but probably the hardest to actually implement. Like Set / Get MAX_SPEED, this would change the fundamental turnRate of the Unit, with a value of 1 = 0 turnRate.
Why do I want this? So that I can (finally) lock up mobile Units entirely, via script. It will probably be a pain to implement, since it'll have to be reflected in the pathfinder code (just in case we want to get fancy, and set this to non-zero values, for Units that can turn more / less quickly under certain circumstances).
Stop-Script is a command that would require a change to the Compiler.cfg in Scriptor to use. Basically, it would return a FALSE to any script started via Start-Script, so that any script using the syntax:
MyScriptName()
{
While(TRUE)
{
Do something
}
}
Would be halted, until restarted. Currently, there's no way to do this- and you can only get around this by having a variable check that makes the script exit every few updates, at best. It's wasteful, and I think it'd be better to just be able to stop the script.
Lastly, WeaponLockout. Basically, Spring calls up weapons whenever a valid target gets into range (for that matter, whenever invalid targets get into range, it at least calls, but will not continue). There is no way to keep this from happening. We (scripting folks) have coded various lockouts, using fake weapons, but they don't work reliably, at least in my experience (if anybody has a script that provably works 100% reliably, I'm listening, but I've tested several approaches, and they all lead to unbreakable locks under certain conditions, unfortunately).
Basically, we could go with two different approaches:
1. Just set up a minimum-range FBI tag.
2. Code a SET / GET WeaponLockout value that simply prevents the slave weapon from ever trying to activate, if the master is active. Which would be more flexible, but I'm not entirely sure that it'd be 100% reliable, given how weapons get / release their active states (a weapon, once active, is always active, until a script releases it with Return(TRUE), so far as I can tell, and even then, it may not work right).
For example... we could write up a script like this:
AimWeapon1()
{
If(aiming)
{
SET WeaponLockout Weapon2 to 1;
}
}
FireWeapon1()
{
SET WeaponLockout Weapon2 to 0;
}
Which would prevent Weapon2 from ever trying to aim when Weapon1 was active, period.
I just want a minimum-range method that works 100% reliably, basically. I don't care how it works, really, so long as it does. That's been a MTR for quite awhile, so I'm hoping that somebody has the time to look into this.
Why do I want this? So that I can (finally) lock up mobile Units entirely, via script. It will probably be a pain to implement, since it'll have to be reflected in the pathfinder code (just in case we want to get fancy, and set this to non-zero values, for Units that can turn more / less quickly under certain circumstances).
Stop-Script is a command that would require a change to the Compiler.cfg in Scriptor to use. Basically, it would return a FALSE to any script started via Start-Script, so that any script using the syntax:
MyScriptName()
{
While(TRUE)
{
Do something
}
}
Would be halted, until restarted. Currently, there's no way to do this- and you can only get around this by having a variable check that makes the script exit every few updates, at best. It's wasteful, and I think it'd be better to just be able to stop the script.
Lastly, WeaponLockout. Basically, Spring calls up weapons whenever a valid target gets into range (for that matter, whenever invalid targets get into range, it at least calls, but will not continue). There is no way to keep this from happening. We (scripting folks) have coded various lockouts, using fake weapons, but they don't work reliably, at least in my experience (if anybody has a script that provably works 100% reliably, I'm listening, but I've tested several approaches, and they all lead to unbreakable locks under certain conditions, unfortunately).
Basically, we could go with two different approaches:
1. Just set up a minimum-range FBI tag.
2. Code a SET / GET WeaponLockout value that simply prevents the slave weapon from ever trying to activate, if the master is active. Which would be more flexible, but I'm not entirely sure that it'd be 100% reliable, given how weapons get / release their active states (a weapon, once active, is always active, until a script releases it with Return(TRUE), so far as I can tell, and even then, it may not work right).
For example... we could write up a script like this:
AimWeapon1()
{
If(aiming)
{
SET WeaponLockout Weapon2 to 1;
}
}
FireWeapon1()
{
SET WeaponLockout Weapon2 to 0;
}
Which would prevent Weapon2 from ever trying to aim when Weapon1 was active, period.
I just want a minimum-range method that works 100% reliably, basically. I don't care how it works, really, so long as it does. That's been a MTR for quite awhile, so I'm hoping that somebody has the time to look into this.