What you are asking for is a function that probably only you would useI completely disagree
Yes it's kind of about manpower, but they aren't going to let you or any other random person they don't know anywhere near the source code.What you are asking for is a function that probably only you would useI completely disagree
Its cool to have the possibility of letting people with little-no-none programming experience develop games. But this product comes with a scriping-engine and claims to be ready for the professional market. And that means: dont think about what you want to do with a module, just implement everything that can be logically done to the module, because someone will come up with a use for it. Especially, if its not reinventing the weel but just exposing a process already implemented (creation of animations from given parameters) to the already implemented scripting-engine.
BTW, if its just about man-power:
C++, C#, Java, Javascript and Perl (and some long time not used Basic dialects^^) is what I can offer
qp.aniIdx = 0
qp.template = getObject("Animations[tunnel0a]")
qp.fileAlt2 = "Kulissen/UBahn/Tunnel2.jpg"
qp.createAnimation = function(self,base)
local name = "QPBckgnd"..tostring(self.aniIdx)
local dbl = self.template:duplicate(name)
dbl.AnimationSprites[1].path = self.fileAlt2
startAnimation(dbl)
self.aniIdx = self.aniIdx + 1
local ret = getObject("ActiveAnimations["..name.."]")
-- *do something*
return ret
end
23:44:18.550:----- animation data start ------
23:44:18.550:getName(): QPBckgnd0
23:44:18.551: [info()]: table: 0x037df760
23:44:18.551: .[AnimationMove]: false
23:44:18.551: .[AnimationUseIndividualPause]: false
23:44:18.551: .[AnimationNumberOfLoops]: 0
23:44:18.551: .[AnimationAction]: ---Empty---
23:44:18.551: .[AnimationCenter]: table: 0x037e1988
23:44:18.551: ..[y]: 0
23:44:18.551: ..[x]: 0
23:44:18.551: .[AnimationPosition]: table: 0x037dfa68
23:44:18.551: ..[y]: 0
23:44:18.551: ..[x]: 0
23:44:18.551: .[_Name]: QPBckgnd0
23:44:18.551: .[AnimationPropertyFrames]: table: 0x037e1a18
23:44:18.551: .[AnimationModelAnimIndex]: -1
23:44:18.551: .[AnimationReplay]: 0
23:44:18.551: .[AnimationPause]: 20
23:44:18.551: .[AnimationWalkSteps]: table: 0x037dfb78
23:44:18.551: .[AnimationLoopRandom]: false
23:44:18.551: .[AnimationDirection]: -1
23:44:18.551: .[AnimationPauses]: table: 0x037dfc48
23:44:18.551: .[AnimationEndDirection]: -1
23:44:18.551: .[AnimationMirror]: ---Empty---
23:44:18.551: .[_Type]: Animation
23:44:18.551: .[AnimationSprites]: table: 0x037dfca0
23:44:18.551: ..[1]: table: 0x037df880
23:44:18.551: ...[path]: Kulissen/UBahn/Tunnel0.jpg
23:44:18.551: ...[position]: table: 0x037df8a8
23:44:18.551: ....[y]: 0
23:44:18.551: ....[x]: 0
23:44:18.551: ...[pause]: 0
23:44:18.551: ...[transparency]: 2
23:44:18.551: ...[transpcolor]: 0
23:44:18.551: .[AnimationModelName]:
23:44:18.551: .[AnimationModelAnimSpeed]: -1
23:44:18.551: .[_Id]: table: 0x037df820
23:44:18.551: ..[tableId]: 9
23:44:18.551: ..[id]: 60
23:44:18.551: .[_Parent]: MovingTunnel (6,71)
23:44:18.551: .[AnimationModelFile]:
23:44:18.551:------ animation data end -------
ret.fileAlt2 = "Kulissen/UBahn/Tunnel2.jpg"
ret.aniIdx = 0
ret.template = getObject("Animations[tunnel0a]")
ret.createAnimation = function(self,base)
local name = "QPBckgnd"..tostring(self.aniIdx)
local dbl = self.template:duplicate(name)
local sprites = dbl:getSprites(VAnimationSprites)
-- works but just changes value in table, not in game
sprites[1].path = self.fileAlt2
-- error: "attempt to call method 'setPath' (a nil value)"
sprites[1]:setPath(self.fileAlt2)
startAnimation(dbl)
self.aniIdx = self.aniIdx + 1
local ret = getObject("ActiveAnimations["..name.."]")
return ret
end
local sprite = "vispath:images/ball.png"
linking to files for images, sounds, videos & so on requires you to add vispath: in front of the path.That doesnt answer the question. It is:local sprite = "vispath:images/ball.png"
Sorry mate, I really don't know. None of us ever bother creating anything like this.Of course, I dont want to do the animation in Lua, its just the set-up of the animation should happen there. I still need to know how I can get a TSprite from the table returned by :getSprites(VAnimationSprites), as TSprite has the abillity to set the path with its :setPath()-Method. I just cant find any documentation how to get access to it. And :getSprites(VAnimationSprites) doesnt return an array of TSprites (which would be expected), it just a returns a table of data, which is quite useless.
Quick question: you do know it's possible to draw images/text via Lua script? I believe those images can be moved, rotated, scaled as you like as well as being able to adjust the transparency too. I'm pretty sure there's some examples Simon wrote floating around on the luadocs website...
local spr = Animations["example"]:getSprites(VAnimationSprites)
for i = 1, #spr do
print(spr[1])
end