Author Topic: The "I want to but I can't" modding requests thread  (Read 11186 times)

0 Members and 1 Guest are viewing this topic.

Jeheace

  • Seedling
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 32
    • Jeheace's Art
New flower!
« Reply #45 on: August 03, 2010, 07:52:39 AM »
Perhaps this has been suggested, but if not then mayhaps someone might add a new type of dyson flower...

One that allowed you to improve an asteroids stats... their power, speed, and energy... perhaps increase in size even...

Terrial

  • Sapling
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 66
Re: The "I want to but I can't" modding requests thread
« Reply #46 on: August 12, 2010, 09:00:05 AM »
I came up with an interesting idea.  What if some one (Like everyone else, I'm looking at you annikke haha) made an engine to alter time? For instance, seedlings would stop moving in a region where the time warp is occurring.  Seedling and tree growth would also stop (This part still needs Alex to make a way to alter existing tree properties).  These time warps could randomly occur and disappear on the map and would make for some interesting levels.

Another idea is if there were a way to move seedlings instantly across the map, similar to the time warp, spacial warps would occur randomly and move all of the seedlings to a different asteroid.

If these two are combined, it would make for a most chaotic and interesting level.

Sniped50

  • Sapling
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 97
  • Don't ask. About anything.
Re: The "I want to but I can't" modding requests thread
« Reply #47 on: August 12, 2010, 01:02:18 PM »
Hmmmm. Interesting ideas, Terrial.

I'm not annikk (obviously :P), but I can tell you I don't think the time warp is possible. It would involve calculating each asteroid's time state, each tree's time state, each seedling's time state, etc. Then you'd have to figure out a way of altering those time states through Lua. Of course, if temporal warps are possible, then having them randomly appearing on the map could easily unbalance the level in someone's favour, or it could utterly mess up the orbits of any asteroids that use gravity.

I can also tell you that the spacial warp is most definitely possible, but again, will have the tendency to give one side the advantage over another if they randomly occur.

They were good ideas though. If annikk can get them working, then that would be cool. Besides, I didn't predict the gravity engine now, did I? ;D
"Sometimes, the simplest solutions work the best."
- Mythbusters

"But the complex solutions look prettier."
- Me

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1,794
Re: The "I want to but I can't" modding requests thread
« Reply #48 on: August 15, 2010, 12:29:00 AM »
Well lets see... you could adjust the speed of seedlings around particular asteroids, and slow the growth of trees and flowers on that asteroid...  you could slow the movement of defense tree missiles, and various other things.
That would produce a pretty convincing time-slowing effect.  Seeds arriving at the asteroid would appear to slow down, combat would be conducted at a more sedate pace, and they would remain slow until they reach another asteroid that operates on "normal time".  Or "fast time".

You could program in seasonal time fluctuations and alter the background colour to indicate the different positions in the cycle.

Lots of other possibilities to this as well, like time speeding up in certain areas as the different factions acquire more seedlings.



The problem is that there is no way to select seedlings for scripting.  There is no GetAsteroid(0):GetSeedlings(faction,number) command.  There is no GetSeedlings(faction,number,X1,Y1,X2,Y2).  This means that currently we are limited to changing the speed of asteroid properties only, which completely does not work for a timebending effect.

This highlights the need for greater seedling control.. :>

Mihhaelo

  • Sapling
  • **
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 67
Re: The "I want to but I can't" modding requests thread
« Reply #49 on: October 31, 2010, 03:16:41 PM »
Quote
The problem is that there is no way to select seedlings for scripting.  There is no GetAsteroid(0):GetSeedlings(faction,number) command.  There is no GetSeedlings(faction,number,X1,Y1,X2,Y2).  This means that currently we are limited to changing the speed of asteroid properties only, which completely does not work for a timebending effect.

I'm not sure how useful the following is, you're welcome to play around with it.

This will give you a table of seedlings at Asteroid(n).
Code: [Select]
b = GetAsteroid(n):Seedlings(playernumber)
If you want a specific seedling you can use...
Code: [Select]
b = GetAsteroid(n):Seedlings(playernumber)[0]
Likewise, the same applies to flowers and mines. Probably better to use than the random function.
Code: [Select]
b = GetAsteroid(n):Flowers()
b = GetAsteroid(n):Mines()

I'm not sure how to refresh/update seedling changes. If it's possible to do, then a timebending map would be quite easily. Although the effects would have to be localised, otherwise the code would run a tad slow.

Quote
A way to differentiate between seedlings of different qualities when referring to them in scripts.  For example, it would be nifty if you could instruct seeds with a high speed stat/best overall stats/etc to travel somewhere, instead of just "seeds in general".

There are two functions that might be able to do this.

GetAsteroid(n):GetSeedlingsWithAttrib(num,EmpireID)
GetAsteroid(n):GetNumSeedlingsWithAttrib(num,EmpireID)

I've not figured out what the first number does quite yet. I think these are probably used when you double click planets to send stronger seedlings. I think these are the corresponding globals... someone should have a play around with it, to see if they can figure it out.

Globals.Agents.SendThresholdStrength = 0.6
Globals.Agents.SendThresholdEnergy = 0.6
Globals.Agents.SendThresholdSpeed = 0.6

Quote
If I had to pick one thing I want implemented into LUA, I'd say that the code for telling what an empire's colour scheme is would suffice. All you would need is the line

GetEmpire(ID).GetEmpireColour(red,green,blue)
I figured out a way of doing this the other day, when the colour settings on my lastest map didn't work.

Here's an example map. Keep in mind that the function used, requires an actual leaf to function. So if you are using it to draw, you'll have to put a one second delay into the LevelDraw function. The two couroutine.yields are at the start of the code to give the tree's time to spawn leaves as well.

Code: [Select]
function LevelSetup()
   Globals.G.Asteroids = (0)
Globals.G.EnemyFactionsMin = (0)
Globals.G.EnemyFactionsMax = (0)
Globals.G.MinAsteroidSeparation = (0)
Globals.G.MaxAsteroidNeighbourDist = (20000)
Globals.G.GreysProbability = (0)

Globals.Asteroids.MinSendDistance = (12000)
Globals.Asteroids.MaxSendDistance = (12000)

   a= AddAsteroidWithAttribs(0,0,1,1,1)
a.Owner = 1
for n=1,4 do
    s = a:AddDysonTree()
    s:LevelUp()
    s:LevelUp()
    s:LevelUp()
end
a:Reveal(1)
a:AddSeedlings(40)

end

function LevelDraw()
   if GetGameTime() > 1 then
      for n=0,(GetNumAsteroids()-1) do
         if GetAsteroid(n).Owner == 1 then
            x, y, r = GetAsteroid(n).position.x, GetAsteroid(n).position.y, GetAsteroid(n).Radius
          DrawSprite(5, x,y, playercolour.r,playercolour.g,playercolour.b,0.99, r * 1.15)
         end
      end
end
end

function LevelLogic()
   coroutine.yield()
coroutine.yield()
playercolour = GetAsteroid(0):GetRandomTree():GetLeafColour(0)

   Display = 1
   while GameRunning() do
   coroutine.yield()
end
end

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1,794
Re: The "I want to but I can't" modding requests thread
« Reply #50 on: January 12, 2011, 02:15:38 AM »
I discovered a problem today that I've not run into before.
I can't seem to set the "CurrentEnergy" property of a Mine.  I can read what the value is, but I can't actually change it.


Code: [Select]
playermine.CurrentEnergy = playermine.CurrentEnergy + 1
Does not work.  :/  Returns an error "property set method not found".

Alex

  • Administrator
  • Ent
  • *****
  • Thank You
  • -Given: 3
  • -Receive: 13
  • Posts: 1,035
Re: The "I want to but I can't" modding requests thread
« Reply #51 on: January 12, 2011, 11:23:28 AM »
Hmm, I guess you could set up or use a dummy entity like a seedling of a certain type (e.g. created on an asteroid with known attributes), and call Mine:AttackedBy(seedling) multiple times until the energy is somewhere near where you wanted it.

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1,794
Re: The "I want to but I can't" modding requests thread
« Reply #52 on: January 12, 2011, 11:26:57 AM »
What does "AttackedBy" do?  The reference says it tells the entity it was attacked by the one passed in.  Ok, so it knows it was attacked...what does it do in response to that information?  :>

I'm looking for a way to make a mine's energy tick up over time, healing it without the need to replace the mine with a fresh, uninjured one.

Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 17
  • Posts: 899
  • Eufloria: Yes
Re: The "I want to but I can't" modding requests thread
« Reply #53 on: January 12, 2011, 04:11:33 PM »
playermine.Attribs.Energy might work. Or not, I don't know, will test.

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1,794
Re: The "I want to but I can't" modding requests thread
« Reply #54 on: January 12, 2011, 04:37:37 PM »
Nope, been using that a lot already and it governs the Energy stat of the entity (as opposed to the "CurrentEnergy", which refers to core health or just health).

Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 17
  • Posts: 899
  • Eufloria: Yes
Re: The "I want to but I can't" modding requests thread
« Reply #55 on: January 12, 2011, 04:51:30 PM »
Ah. I couldn't get it to work. That's probably why.

Alex

  • Administrator
  • Ent
  • *****
  • Thank You
  • -Given: 3
  • -Receive: 13
  • Posts: 1,035
Re: The "I want to but I can't" modding requests thread
« Reply #56 on: January 12, 2011, 05:06:29 PM »
Everything in the game heals. Call Regen(t) where t is usually a frame time.

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1,794
Re: The "I want to but I can't" modding requests thread
« Reply #57 on: January 12, 2011, 05:59:38 PM »
Returns an error, "attempt to call method 'Regen' (a string value).

The line I'm using is:

Code: [Select]
playermine:Regen(0.5)

Where "playermine" refers to a laser mine belonging to Empire 1.

Alex

  • Administrator
  • Ent
  • *****
  • Thank You
  • -Given: 3
  • -Receive: 13
  • Posts: 1,035
Re: The "I want to but I can't" modding requests thread
« Reply #58 on: January 13, 2011, 10:22:34 AM »
Ah, oops. It's not a public method, sorry. I don't think I can help you :(

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1,794
Re: The "I want to but I can't" modding requests thread
« Reply #59 on: January 13, 2011, 10:48:19 AM »
Ok no worries.  Would have been nicer if I could regen injured mines in a slow and steady fashion, but 1 big jump (from replacing the mine with a fresh one) works ok too.  :>