Page 1 of 1
D-gun delay option?
Posted: 24 Mar 2007, 18:20
by TradeMark
Would be nice for preventing instant dgun when spawning at same spots at FFA...
So i could limit dgunning from start of game for example 10 seconds.
Posted: 24 Mar 2007, 19:54
by KDR_11k
Script it yourself.
Posted: 26 Mar 2007, 02:49
by manored
Since all commanders have the same speed, you could just follow the enemy until the time is over... no one will dgun the enemy if they pretend to live cause they know that will kill em too, so they will just run in the oposite direction.
Posted: 26 Mar 2007, 03:12
by trepan
LuaRules/main.lua:
Code: Select all
function AllowCommand(unitID, unitDefID, teamID, cmdID, cmdParams, cmdOpts)
if ((cmdID == CMD.DGUN) and (Spring.GetGameSeconds() < 10)) then
return false
end
return true
end
Alternate version (avoids AllowCommand() call-in slowdowns after 10 seconds)
Code: Select all
function AllowCommand(unitID, unitDefID, teamID, cmdID, cmdParams, cmdOpts)
if (Spring.GetGameSeconds() >= 10) then
AllowCommand = nil
return true
end
return (cmdID ~= CMD.DGUN)
end
Posted: 26 Mar 2007, 07:47
by KDR_11k
Or
Code: Select all
static-var TooSoon;
Create()
{
TooSoon=1;
sleep 10000;
TooSoon=0;
}
AimWeaponX()
{
<normal aiming stuff>
return (!TooSoon);
}
Posted: 26 Mar 2007, 17:07
by TradeMark
KDR_11k wrote:Script it yourself.

Posted: 26 Mar 2007, 17:14
by KDR_11k
Well, you're adding files to the mod already so why not decompile the armcom and corcom.cob files, drop those few lines in there, recompile and throw them into the scripts folder of your next map?
Posted: 26 Mar 2007, 17:28
by TradeMark
I thought there could be easier way.
Posted: 26 Mar 2007, 18:05
by KDR_11k
That's as easy a way as they come. Patching something hardcoded into the engine is much more complicated and will just annoy future modders who run into the limitations you leave them with that method.
Posted: 26 Mar 2007, 18:17
by Peet
TradeMark wrote:KDR_11k wrote:Script it yourself.

It would be possible with about 5 more lines of bos ^_^
Posted: 26 Mar 2007, 18:42
by KDR_11k
In fact I already wrote those lines in my post.
Posted: 26 Mar 2007, 18:52
by trepan
One advantage to the LuaRules approach is that you can
send the team an informative message should it try to dgun
before it is allowed. The dgun/attack icon will also not
appear in the command queue, as the command will have
been discarded.
Spring.SendMessageToTeam(teamID,
"Can not dgun for another " .. (10 - Spring.GetGameSeconds()) .. " seconds")
P.S. Note that the player information is not available in the
AllowCommand() call-in...
P.P.S. One disadvantage is that you will also be blocking
queued dgun commands that would have been executed
after the time limit was passed.
Posted: 26 Mar 2007, 19:15
by KDR_11k
But what happens if you go into FPS mode and fire?
Posted: 26 Mar 2007, 19:27
by manored
There are 3 things that would happen then 2 commanders born next to each other...
Both wanna die: and they kill each other...
One wanna die: and he chases the other until the boom...
None wanna die: and they run in oposite directions just like em do right now...
Conclusion: This wouldnt really be usefull... :)
Posted: 26 Mar 2007, 19:46
by trepan
KDR_11k:
Good point

Looks like direct control bypasses the normal command mechanism.
Posted: 26 Mar 2007, 20:29
by smoth
kdr_11k's implementation would work fine guys, why are you giving him a hard time.
note: !applicatble to trepan
Posted: 07 Apr 2007, 18:05
by Ansuz
manored wrote:There are 3 things that would happen then 2 commanders born next to each other...
Both wanna die: and they kill each other...
One wanna die: and he chases the other until the boom...
None wanna die: and they run in oposite directions just like em do right now...
Conclusion: This wouldnt really be usefull... :)
However if one of the commanders is an AI this may be quite a different problem....
