Amabilis Software    3D Canvas Community    3D Canvas Discussion Forums  Hop To Forum Categories  Plug-In Development and Scripting    Explosion Script For Planetoides
Go
New
Find
Notify
Tools
Reply
  
5-star Rating (1 Vote) Rate It!  Login/Join 
Junior Member
Picture of draicker2003
Posted
Hi

the foloowing script isn't tested but if it's ok it would make an enhanced part of an planetoidal explosion

here is how to make this particular scene
ad an object and rename it explo or something like that.
then ad some asteroides you can find on media downloads of 3d canvas around the object very close to each other (but not on the same position as the group named explo).
set all asteroides group childs of explo and delete the object that was in explo
the run the folowing script named "Planet Explosion"
quote:

Language=Vbscript

'Purpose explosion mouvement
'Can be used to create an explosion of a planet
Dim Scene, GrCount, GroupEx,, GrN PosX, PosY, PosZ, GrEx,
Dim CanvApp, FPS, FrEnd, FrBeg, Speed
Sub Main(CanvasApp)
Dim Msg, Title, Style, Resp,
Msg = "Do you want to create an explosion?"
Title = "!!! Expolsion Imenent !!!"
Style = vbYesNo
Resp = MsgBox(Msg, Style, Title)
If Resp = vbYes then
Set CanvApp = CanvasApp
Set Scene = CanvasApp.GetActiveScene
GrN = Inputbox("Give name ogf group where child must explode:")
FPS = Inputbox("How many Frames do you want per seconds:",30)
Scene.SetAnimationKeyFPS(FPS)
FrBeg = Inputbox("when must this animation begin:",0)
FrEnd = Inputbox("when must this animation end:",90)
Speed = Inputbox("set the animation speed,1 is standard speed:",1)
GrCount = Scene.GetGroupCount()
Dim C1, Gt, Gn,
For C1 = 0 To GrCount-1
Set Gt = Scene.Getgroup(C1)
Gn = Gt.GetName()
If Gn = Grn Then
Set GroupEx = Scene.GetGroup(C1)
End if
Next
GrCount = GroupEx.GetChildCount()
Else
Title = "!!! Warning !!!"
Style = VbOKOnly
Msg = "This Animation will not be maded!"
Dim Resp2
Resp2 = MsgBox(Msg, Style, Title)
Endif
End Sub
Sub AnimateGroup(Time, CanvasGroup)
If Resp = vbYes Then
Dim C2, TimEnd, Timer, TimBeg, Dper
TimBeg = FrBeg/FPS
TimEnd = FrEnd/FPS
For C2 = 0 To GrCount-1
Dper = 0
Dper = Dper+Speed
set GrEx = GroupEx.GetCild(C2)
GrEx.GetPosition GroupEx, PosX, PosY, PosZ
For Timer = TimBeg To TimEnd
GrEx.SetPosition GroupEx, Timer, PosX*Dper, PosY*Dper, PosZ*Dper
Next
Next
End if
End Sub



I hope it will orkand that you will enjoy it
i'm not so good in scripting

Bye


Draicker2003
 
Posts: 85 | Location: Leuven,Belgium | Registered: Fri November 07 2003Reply With QuoteEdit or Delete MessageReport This Post
Member
Picture of korben
Posted Hide Post
so how do i get this script and put it into 3dc? i have not yet tried using a script posted like this.

thanks,

-korben
 
Posts: 297 | Location: oregon, USA | Registered: Thu January 01 2004Reply With QuoteEdit or Delete MessageReport This Post
Member
Posted Hide Post
You select "New script" and then save it.
EDIT: This script doesn't work, it won't even save. Just gives an error.


"Eat me! See if I care."
 
Posts: 118 | Location: Finland | Registered: Fri November 07 2003Reply With QuoteEdit or Delete MessageReport This Post
KB
Member
Picture of KB
Posted Hide Post
Hello Draicker2003,
I copied & pasted the script into the "Create Scripts" - but it wont validate. Any ideas to why? [me or it]
KB
 
Posts: 540 | Location: Carnelian Bay, Ca. | Registered: Fri November 07 2003Reply With QuoteEdit or Delete MessageReport This Post
Junior Member
Picture of draicker2003
Posted Hide Post
hi KB
there are some errors on so as i said i had not test it since i tested.
when i have tested it didn't do as i espected i'm not so good in scripting.
can some one helping me out with this please
here the code back
 
Language=Vbscript
 
'Purpose explosion mouvement
'Can be used to create an explosion of a planet
Dim Scene, GrCount, GroupEx, GrN, PosX, PosY, PosZ, GrEx
Dim CanvApp, FPS, FrEnd, FrBeg, Speed
Sub Main(CanvasApp)
      Dim Msg, Title, Style, Resp
      Msg = "Do you want to create an explosion?"
      Title = "!!! Expolsion Imenent !!!"
      Style  = vbYesNo
      Resp = MsgBox(Msg, Style, Title)
      If Resp = vbYes then
         Set CanvApp = CanvasApp
         Set Scene = CanvasApp.GetActiveScene
         GrN = Inputbox("Give name ogf group where child must explode:")
         FPS = Inputbox("How many Frames do you want per seconds:","Animation Frame/seconds",30)
         Scene.SetAnimationKeyFPS(FPS) 
         FrBeg = Inputbox("when must this animation begin:","Begin animation sequence",0)
         FrEnd = Inputbox("when must this animation end:","end of animation sequence,90)
         Speed = Inputbox("set the animation speed,1 is standard speed:","Speed velocity",1)
         GrCount = Scene.GetGroupCount()
         Dim C1, Gt, Gn
         For C1 = 0 To GrCount-1
               Set Gt = Scene.Getgroup(C1)
               Gn = Gt.GetName()
               If Gn = Grn Then
                  Set GroupEx = Scene.GetGroup(C1)
               End if
         Next
         GrCount = GroupEx.GetChildCount()
      Else 
          Title = "!!! Warning !!!"
          Style = VbOKOnly
          Msg = "This Animation will not be maded!"
          Dim Resp2
          Resp2 = MsgBox(Msg, Style, Title)
      End if
End Sub
Sub AnimateGroup(Time, CanvasGroup)
      If Resp = vbYes Then
         Dim C2, TimEnd, TimBeg, Dper
         TimBeg = FrBeg/FPS
         TimEnd = FrEnd/FPS 
         For C2 = 0 To GrCount-1
              Dper = 0
              Dper = Dper+Speed
              set GrEx = GroupEx.GetCild(C2)
              GrEx.GetPosition GroupEx, PosX, PosY, PosZ
              For Time = TimBeg To TimEnd
                   GrEx.SetPosition GroupEx, Timer, PosX*Dper, PosY*Dper, PosZ*Dper
              Next
        Next
     End if                           
End Sub
  



If any one can correct this thanks


Draicker2003
 
Posts: 85 | Location: Leuven,Belgium | Registered: Fri November 07 2003Reply With QuoteEdit or Delete MessageReport This Post
Junior Member
Picture of draicker2003
Posted Hide Post
Hi
here is som update of explosion script
if some one can correct it do it

Thanks


Draicker2003


Zip/GZ archivePlanet_Explosion.zip (1 Kb, 13 downloads) Palanet Explosion
 
Posts: 85 | Location: Leuven,Belgium | Registered: Fri November 07 2003Reply With QuoteEdit or Delete MessageReport This Post
 Previous Topic | Next Topic powered by eve community  
 

Amabilis Software    3D Canvas Community    3D Canvas Discussion Forums  Hop To Forum Categories  Plug-In Development and Scripting    Explosion Script For Planetoides

© Amabilis Software 2003-2007