View topic - CEG<->LUA call



All times are UTC + 1 hour


Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: CEG<->LUA call
PostPosted: 14 Apr 2012, 09:40 
User avatar

Joined: 01 Apr 2010, 20:05
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


Top
 Offline Profile  
 
 Post subject: Re: CEG<->LUA call
PostPosted: 03 May 2012, 10:28 
Moderator
User avatar

Joined: 22 Feb 2006, 01:02
Location: cheap kitchen
do you mean CEGs that are "dynamic" and can change?
eg like this, some ceg file:
--
Code:
--change color when height is above 500
if (position.y > 500) then
color = [[1,0,0]]
else
color = [[0,0.5,0.5]]
end
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.

Quote:
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
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:
viewtopic.php?f=14&t=26888


Top
 Online Profile  
 
 Post subject: Re: CEG<->LUA call
PostPosted: 03 May 2012, 12:02 
User avatar

Joined: 01 Apr 2010, 20:05
knorke wrote:
do you mean CEGs that are "dynamic" and can change?
eg like this, some ceg file:
--
Code:
--change color when height is above 500
if (position.y > 500) then
color = [[1,0,0]]
else
color = [[0,0.5,0.5]]
end


Well there gives operators that can dynamically change their behavior more or less
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


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:

You don't mean the operators like I/D/K/M/Y and so on...?
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.


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: No registered users and 0 guests


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.