View topic - dynamic power control



All times are UTC + 1 hour


Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: dynamic power control
PostPosted: 19 Sep 2011, 09:46 
Moderator

Joined: 12 Oct 2007, 08:24
This would be for target acquisition control that does not require extensive unit target checks. (I assume power is a unit attribute used in target acquisition...)

Something like "Spring.SetUnitPower(unitID, newPower)". If this was added a getter would be useful as well.

I know you can currently modify xp for limited control of power but that is a really really bad workaround.


Top
 Offline Profile  
 
PostPosted: 19 Sep 2011, 12:57 
Moderator
User avatar

Joined: 22 Feb 2006, 01:02
Location: cheap kitchen
i think this is already possible using TargetWeight and BlockShot in unit scripts? I never got that to work though :?
In this file: https://github.com/spring/spring/blob/master/rts/Lua/LuaRules.h the callins AllowWeaponTargetCheck & AllowWeaponTarget also look promising. (for 0.83)

Quote:
I know you can currently modify xp for limited control of power but that is a really really bad workaround.
Assuming the game uses experienceMult=0 and xp is used for nothing else, what side effects does it have?


Top
 Offline Profile  
 
PostPosted: 19 Sep 2011, 14:00 
Moderator

Joined: 12 Oct 2007, 08:24
The request stems from this thread. In this example I would like to make every single unit treat this unit as a less important target when closed, this would be trivial to do in the unit script if lua could modify power.

The new callins look promising but they seem like overkill for this application. Any solution with these callins looks like it would be slower than a power modification as every unit would need to use the callin to modify the weight of a single target.

Quote:
Assuming the game uses experienceMult=0 and xp is used for nothing else, what side effects does it have?
From a comment in modrules.lua
Code:
power = default power * (1 + (powerScale * xp/(1 + xp) ) )
This gives a limit range; power range = default power*[1, 1+powerScale)

To be able to 'lose power' a unit must be created with xp. Anyway ZK uses XP to some extent so this isn't a solution. It demonstrates to me that power modification during the game is technically possible (well the parameter could be broken....)


Top
 Offline Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: Google [Bot] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group

Site layout created by Roflcopter et al.