Movectrling units into other units bad things

Movectrling units into other units bad things

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

Post Reply
User avatar
Zpock
Posts: 1218
Joined: 16 Sep 2004, 23:20

Movectrling units into other units bad things

Post by Zpock »

When movectrl is used in such a way that a unit moves into the radius of another unit, the movectrld unit dissapears. This is really annyoing. I tried both of

Code: Select all

            Spring.MoveCtrl.SetNoBlocking(unitID,true)
            Spring.MoveCtrl.SetCollideStop(unitID,false)
But neither seems to help with this problem.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: Movectrling units into other units bad things

Post by KDR_11k »

Strange, I had that happen with slopes that are too steep (the unit gets teleported to its pre-movectrl location) but not other units. Probably some code that prevents an impulse-thrown unit from ending up in an invalid position.
User avatar
Zpock
Posts: 1218
Joined: 16 Sep 2004, 23:20

Re: Movectrling units into other units bad things

Post by Zpock »

When using movectrl, there's a million times where you want the unit to be on top of other units. Launching units from other units to name one. You also don't really want to make careful checks that unit's being movectrld don't move into some other units by whatever random reason. That's just bound to happen, and when it does, ending up in invalid positions or some clipping isn't cathastropic, having the unit flat out dissapear really is.

Might just be some local error on my part but I'm pretty sure. It has to be a movectrl unit inside the radius of another not movectrld unit.

Try for example enabling movectrl on a unit that's just out of a factory, when the next unit being built appears, the movectrld unit will dissapear.

If this isn't a bug but intended, I really disagree strongly on this setup. The engine shouldn't go in and mess up what a script is doing before even releasing a unit from movectrl! It's not the engines business what happens during movectrl.
trepan
Former Engine Dev
Posts: 1200
Joined: 17 Nov 2005, 00:52

Re: Movectrling units into other units bad things

Post by trepan »

Think I've found the cause, it's in GroundMoveType,
near where unitDef->pushResistant is being checked.
The same goes for BuggerOff() in GameHelper. Will
commit the fix after testing.
SpikedHelmet
MC: Legacy & Spring 1944 Developer
Posts: 1948
Joined: 21 Sep 2004, 08:25

Re: Movectrling units into other units bad things

Post by SpikedHelmet »

I've seen something similar, trying to unload units onto terrain slopes that the unit can't be on -- sometimes the units will snap to the nearest flat ground, other times it seems to just disappear, or get dropped way back where it was first picked up.
User avatar
Tribulexrenamed
Posts: 775
Joined: 22 Apr 2008, 19:06

Re: Movectrling units into other units bad things

Post by Tribulexrenamed »

I tryed this out a couple times, and I have figured out how to effectively use exploits with this bug. However, its not really so useful. The teleportation goes the wrong way, from the destination to the origin. One interesting trick to move all your units off the ground in a place where the enemy will build his base in early game, and get out of there so the enemy makes no defense. Then, once his base is established, and the defense is mainly on the front, drop the units and watch them teleport into the enemies base. It rarely works very well, but once I got 5 flash and a commander into a base. If anyone is interested I will post the replay.
Post Reply

Return to “Lua Scripts”