>: CG Forums on 3dtotal - The best forums for CG artists :.
threedy forums home
 


top-table-gradient
Go Back   3DTotal Forums > Help, Advice and Chat > Animation & Rigging Help
bottom-table-gradient

Reply
 
Thread Tools Display Modes
Old 15-06-2005, 02:08 AM   #1
eagle4
Registered User
 
eagle4's Avatar
 
Join Date: Nov 2004
Location: australia
Posts: 98
Thanks: 0
Thanked 0 Times in 0 Posts
crowds and Maxscript

hi, i am making a space battle, and i started using pflow, but i have now moved onto crowds and a bit of maxscript, and i seem to be geting further. ok what i want to happen is when a ship of another team gets within a certain distance then this ship chasses after it. i can set it up between 2 deligates, but i cant set it up so that it checks the closest enemy to chase if there are more than just 1 on each team. also how can i check the speed of an object, because i also want to also stick in a simple check to see if the enemy's speed is less than its own speed, then chase, because this way i can change the outcome of the whole animation by just altering the speed of a few deligates. But i cant work out how to set a speed and how to check it using maxscript.

when the chaser gets close enough to the one getting chased i want him to shoot, so i figure i need to set up a particle system and get maxscript to check the distance and then somehow fire a particle from that ship, do i need a particle system for each ship? and if it hits then i want the ship that got hit to blow up and dissapear, blow up shouldnt be too hard, just use particles to do that, but getting it to dissapear and then tell the chasser to find another target is my next problem. does anyone have any ideas?

i am new to maxscript, i have used visual basic so i have a basic understanding of programming.

any tips would be appreciated, weather you solve my whole problem, or just 1 thing, it would be great.



eagle4
__________________
common sence isnt quite so common...
eagle4 is offline   Reply With Quote
Old 16-06-2005, 11:38 PM   #2
MaggieQue
Registered User
 
MaggieQue's Avatar
 
 
Join Date: Apr 2005
Location: Singapore
Posts: 2,326
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to MaggieQue Send a message via Skype™ to MaggieQue
Awards Showcase
Threedy Top Poster - Silver: Contributing to the forums with 1,000+ posts - Issue reason: Target reached! Threedy Top Poster - Bronze: Contributing to the forums with 100+ posts - Issue reason: Target reached! Speed Animation - Gold: Winner of a speed animation challenge! - Issue reason: For Excellence in Speed Animation 
Total Awards: 3
Do u know how to write Pseudocode or drawing Flow Chart?

If u can show ur logic with either of it, then I will try my best to give u the maxscript.
MaggieQue is offline   Reply With Quote
Old 17-06-2005, 02:05 AM   #3
eagle4
Registered User
 
eagle4's Avatar
 
Join Date: Nov 2004
Location: australia
Posts: 98
Thanks: 0
Thanked 0 Times in 0 Posts
thanks maggie, i will try to write it in pseudocode, so hopefully you can help.




eagle4
__________________
common sence isnt quite so common...
eagle4 is offline   Reply With Quote
Old 17-06-2005, 02:23 AM   #4
eagle4
Registered User
 
eagle4's Avatar
 
Join Date: Nov 2004
Location: australia
Posts: 98
Thanks: 0
Thanked 0 Times in 0 Posts
2 teams of deligates, blue and red are to be attacking each other
what i cant think a way to program is for this code to work for 1 team to search out the other team individually by each deligate. this can be worked to work with red1 shooting at blue1 and blue 2 shooting at red2 etc etc, but i want it to be a bit more procedural than that, i want it to randomly find a member of the other team, this way i can make red win or blue win the battle by just changing their start speed. wander and seek are both crowd behaviours that i hope can be called upon.

ok here's waht happens in my pseudocode. the variable 'distance' is initalised (worked out reguluarly) and it just wanders randomly arround. It then checks if the distance is close enough, to 'see' them and it makes sure the speed of the enemy is less than themselves then it chases after them and if it gets close enough to shoot it shoots, then it checks if the particle (missle, bullet or whatever) hits, if not it keeps shooting until the enemy is dead, or he himself is dead.

This is for the blue team.



Distance = blue position – red position

wander

IF Distance <= 200 and red.speed < blue.speed THEN
seek
IF Distance <= 50 THEN
Shoot
Blue.speed = Blue.speed + 10
go back to the begining
ENDIF
ENDIF


“Shoot”
LOOP
Pflow emit 1 particle from blue deligate
IF particle collides with red deligate THEN
Red explode
ENDIF
ENDLOOP




i hope this helped



eagle4
__________________
common sence isnt quite so common...

Last edited by eagle4; 17-06-2005 at 02:29 AM..
eagle4 is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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. The time now is 10:53 AM.


Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
all images displayed on this site are copyright the original artists and may not be reproduced, copied or published elsewhere without their express permission