Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > New Scripting Engine (GS2)
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 12-31-2006, 08:43 AM
Falcor Falcor is offline
Darth Cucumber
Falcor's Avatar
Join Date: Mar 2001
Location: At School
Posts: 2,874
Falcor is on a distinguished road
Send a message via ICQ to Falcor Send a message via AIM to Falcor Send a message via MSN to Falcor Send a message via Yahoo to Falcor
Unhappy Sub-Emitters

So, I was reading the fine wiki, and I noticed that you can have particles emit other particles. (Called sub-emitters)

NPC Code:

findimg(100).emitter.particle.emitter



Yet, when I set up a script to do just this... the sub-emitter ceases to emit particles (lending doubt to the notion that they really exist)

I've put some sample code together here:

NPC Code:

function onCreated() {
test();
}
function test() {
//Create the Showimg for the particle effects
with(findimg(100)) {
//Position in the middle of the viewing screen
x = screenwidth/2;
y = screenheight/2;
layer = 4;
//Set up the main emitter
with(emitter) {
particle.speed = 100;
particle.angle = 0;
particle.alpha = 1;
particle.image = "bomb.png";
particle.spin = 0;
particle.lifetime = 10;
particle.movementvector = {20,0,0};
attachposition = true;
autorotation = false;
cliptoscreen = true;
wraptoclippingbox = true;
delaymin = 1;
delaymax = 1;
nrofparticles = 1;
maxparticles = 10;
//Set up the so called 'sub emitter'
with(particle.emitter) {
particle.alpha = .5;
particle.speed = 100;
particle.image = "bomb.png"
particle.lifetime = 10;
particle.movementvector = {0,20,0};
delaymin = 1;
delaymax = 1;
nrofparticles = 1;
maxparticles = 5;
}
}
}
}



This should have bombs coming out horizontally (moving right) and those bombs should emit other bombs vertically (moving down)... However only the horizontal bombs show up.

If this code is wrong some how, I welcome anyone to fix it, because this issue its truly perplexing. If sub-emitters are indeed a valid Gscript2 construct, that I would think this code would work. But since it does not, there must be something wrong with it that I can't see anymore having looked at it too long. Fresh perspectives welcome
__________________

subliminal message: 1+1=3
Reply With Quote
  #2  
Old 01-01-2007, 08:17 AM
Falcor Falcor is offline
Darth Cucumber
Falcor's Avatar
Join Date: Mar 2001
Location: At School
Posts: 2,874
Falcor is on a distinguished road
Send a message via ICQ to Falcor Send a message via AIM to Falcor Send a message via MSN to Falcor Send a message via Yahoo to Falcor
I suppose it would be useful to know the minimum amount of attributes one needs to specify for an emitter to emit particles. If both of those code blocks follow that rule, then both of the emitters should emit particles... I believe since the primary emitter emits the bombs, then it would stand to reason that the other emitter should emit particles as well. I've experimented more, but I cannot make the sub-emitter emit particles. Hopefully someone has experienced this problem before and has been able to solve it?
__________________

subliminal message: 1+1=3
Reply With Quote
  #3  
Old 01-02-2007, 10:53 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
Normally they should work but I have not got time to test them yet
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 02:28 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.