Set{Unit,Feature}Blocking questions

Set{Unit,Feature}Blocking questions

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

Post Reply
Google_Frog
Moderator
Posts: 2464
Joined: 12 Oct 2007, 09:24

Set{Unit,Feature}Blocking questions

Post by Google_Frog »

So the new Set{Unit,Feature}Blocking signature is this:

Code: Select all

 Set{Unit,Feature}Blocking(
       number objectID,
       boolean isBlocking,
       boolean isSolidObjectCollidable
       [, boolean isProjectileCollidable
       [, boolean isRaySegmentCollidable
       [, boolean crushable
       [, boolean blockEnemyPushing
       [, boolean blockHeightChanges ]]]]]
     )
What are some of these things? SolidObject? EnemyPushing? Do they all make sense for features?

I would like to set parameters which are late in the signature without overriding the preceding blocking types. I know that I could feed the values of Get{Unit,Feature}Blocking back into the function but that is pretty ugly. Is there currently a way to only set one of the types of blocking?

If there is not then perhaps instead of this massive signature the function could take keys or a table. The parameters for Spring.MoveCtrl.SetGroundMoveTypeData is a good example.
User avatar
Silentwings
Posts: 3720
Joined: 25 Oct 2008, 00:23

Re: Set{Unit,Feature}Blocking questions

Post by Silentwings »

I haven't tried to use this function so I can't offer any help - but what's the problem with callouts having several arguments?

Obviously it would be bad to have hundreds of args but not passing tables unless one needs too makes for simpler code and I guess less lua garbage collection too.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6241
Joined: 29 Apr 2005, 01:14

Re: Set{Unit,Feature}Blocking questions

Post by FLOZi »

Try passing nil to the optional arguments?
Google_Frog
Moderator
Posts: 2464
Joined: 12 Oct 2007, 09:24

Re: Set{Unit,Feature}Blocking questions

Post by Google_Frog »

Wow, nil works.
Post Reply

Return to “Engine”