Well CEG's can be LUA file too but it doesn't seems to make much sense as it doesn't benefit from any additional command or callin/callout's
I guess this way standard CEG could then call features from LUA and it would probably benefit from LUPS too, as well CEG would be then capable of doing much more complexer particle movement.
Obviously there gives BOS LUA (or whatever you name the unit script in LUA) which can call stuff from widgets/gadgets, yet I don't see a point why it shouldn't apply the same for CEG as well
CEG<->LUA call
Moderator: Moderators
Re: CEG<->LUA call
do you mean CEGs that are "dynamic" and can change?
eg like this, some ceg file:
--I think that is not possible because CEGs are only loaded once when the engine starts, after that they can not be changed without reloading the whole CEG.
They are not "living" code unlike widgets or unit scripts, but only read once like some config file.
[wild guess:] would probally require quite some changes.
kind of like that:
http://springrts.com/phpbb/viewtopic.php?f=14&t=26888
eg like this, some ceg file:
--
Code: Select all
--change color when height is above 500
if (position.y > 500) then
color = [[1,0,0]]
else
color = [[0,0.5,0.5]]
end
They are not "living" code unlike widgets or unit scripts, but only read once like some config file.
[wild guess:] would probally require quite some changes.
Even without the callouts it has some benefits: you can use loops, constants and math to create cegs more easily. At least it can save some copy&paste, eg if you want the same effect but with a different color for each version.Well CEG's can be LUA file too but it doesn't seems to make much sense as it doesn't benefit from any additional command or callin/callout's
kind of like that:
http://springrts.com/phpbb/viewtopic.php?f=14&t=26888
Re: CEG<->LUA call
Well there gives operators that can dynamically change their behavior more or lessknorke wrote:do you mean CEGs that are "dynamic" and can change?
eg like this, some ceg file:
--Code: Select all
--change color when height is above 500 if (position.y > 500) then color = [[1,0,0]] else color = [[0,0.5,0.5]] end
Yes this code is a good sample, would allow for more control on how CEG should behave. Because IIRC there hasn't been added any new CEG Behavior since ages, maybe only a few fix like this and that but that is all, which is rare also.
And It already bugs me when other games particles can be much more complexer while spring CEG is somewhat complex for example a tornado/firewhirl or a main CEG that gets followed by many other smaller CEG/Particles that moves around likey they are drunk/LSD, aswell It canno't do that, neither CEG doesn't support animated bitmaps/sprites, well It is do able by using alot of spawner but this is not really flexible since it wouldn't be able to move at all and other things. Not to mention if you try to add an sprites that got over 30 frames it isn't fun to do copy&pasta with it and the chance to make a error doing that is high.
And if you want to rescale it into smaller or bigger then you need to do this as much how many frames/spawner it has and it isn't fun doing that
You don't mean the operators like I/D/K/M/Y and so on...?knorke wrote: Even without the callouts it has some benefits: you can use loops, constants and math to create cegs more easily. At least it can save some copy&paste, eg if you want the same effect but with a different color for each version.
kind of like that:
Well I couldn't find anywhere on the wiki of any additional commands/whatever it is named on a CEG Lua.
For the latter part I already know this, I already use this for spawner effects to create trail like effect.