Prowler Productions
  Dink Smallwood Forum
  Spell help

Post New Topic  
profile | register | faq

Author Topic:   Spell help
FF4LIFE posted 05-07- 05:15 PM CT (US)   Click Here to See the Profile for FF4LIFE   Click Here to Email FF4LIFE  
I have this spell, right now its of the explosion, but thats gonna change, and it casts on a random sprite on the screen with the brain of 2,3,9,10 or 16. But I also want to have a version that hits everyone with the spell once. So i figured i'd use the get_sprite_with_brain command and just loop it til it doesn't find one, then move on to the next brain. But that just keeps casting it on the same sprite til it dies, which is kind of funny looking. But what i need is a way to make it go to the next sprite of that brain...any suggestions? Here's the script that hits just one:
int &crappy = get_rand_sprite_with_this_brain(10, ¤t_sprite);

if (&crappy > 0)
{

int &x = sp_x(&crap, -1);
int &y = sp_y(&crap, -1);
int &junk;
&junk = create_sprite(&x, &y, 0, 50, 1);
sp_script(&junk, "dam-earth");
&magic_level = 0;
draw_status();

}

if (&crappy == 0)
{
int &crap = get_rand_sprite_with_this_brain(9, ¤t_sprite);

if (&crap > 0)
{

int &x = sp_x(&crap, -1);
int &y = sp_y(&crap, -1);
int &junk;
&junk = create_sprite(&x, &y, 0, 50, 1);
sp_script(&junk, "dam-earth");
&magic_level = 0;
draw_status();

}
and so on with the other brains
also, at the bottom i put that ifno sprites with any of the brains are there, it'll cast at a random spot on the screen...but it only goes to 1x, 1y...here's that:
if (&crappy == 0)
{
if (&crap == 0)
{
if (&duck == 0)
{
If (&pig == 0)
{
if (&16 == 0)
{
int rand;
int other;
&rand = random(500, 1);
&other = random(400, 1);
int &junk;
&junk = create_sprite(&rand, &other, 0, 50, 1);
sp_script(&junk, "dam-earth");
&magic_level = 0;
draw_status();
}
}
}
}
}

guess i need suggestions on that too.

Beuc posted 05-08- 10:29 AM CT (US)     Click Here to See the Profile for Beuc  Click Here to Email Beuc     
In PotA's source, you can find "cheat.c", which is an old version of Ultimate Cheat (I think used for debugging).
You can see how he did the "kill ennemies" (basically a fireball of 600*600 pixels with 100 strength).

You may also wait Simon Klaebe release SoB's source (he said it's be released in May..) and study the multiblast spell).

As for your script, I need to think more about it, I don't see the pb...

See you :)

FF4LIFE posted 05-08- 06:30 PM CT (US)     Click Here to See the Profile for FF4LIFE  Click Here to Email FF4LIFE     
I don't want something that just hits all enemies. I want to target each enemy individualy and cast the spell on each. Is that like what he did in SoB?
Drakeman posted 05-09- 02:02 AM CT (US)     Click Here to See the Profile for Drakeman  Click Here to Email Drakeman     
Multiblast basically finds a sprite with brain 9 and zaps it. It then looks for another brain 9 sprite (It may be the same one or a different one... I think) and zaps, until there are no more brain nine sprites on the screen.

I think I put a random break in the loop (magic fail) as well. Have to check when I get back to my home poota.

FF4LIFE posted 05-09- 10:07 PM CT (US)     Click Here to See the Profile for FF4LIFE  Click Here to Email FF4LIFE     
Well, i guess thats one way. Another way would be to use the get_random_sprite command over and over, but each time mark the sprite it did, that way if it chooses it again you can say not to cast it. But this could not hit all sprites and would be quite unefficiant. I might do it like that tho...
btw, just started SoB...kicks major ass. Good job. I would really like the source for that too.
Tamtur posted 05-29- 12:37 PM CT (US)     Click Here to See the Profile for Tamtur  Click Here to Email Tamtur     
Ok, I think I see at least two things you can try.

First of all, in your end script, with a random movement, you forgot the & before your variables when you initted them:
"
int rand;
int other;
&rand = random(500, 1);
&other = random(400, 1);
"

Also, I seem to remember a post a while back that said that dink only looks at the letters of a variable until it recognizes something - and only the first few letters anyway - and you have both &crap and &crappy. Maybe it would help to change one to &ohcrap or something.

As for the next_sprite one, I just had an idea that might help me, too - you could "mark" the ones that you have already tagged by changing their brain to 14.

If you're not using the mouse, you won't have any other sprites with that brain.

As you go searching for, say, brain 2, just switch their brain to 14 after you hit them with the spell and make a loop - when the script finds no more brain 2's, then change all the brain 14's back to brain 2 and move on to brain 3.

Since it's going to happen all in a split second (I'm assuming that's what you are doing) it shouldn't affect the sprites that get their brains switched.

Hope this helps you.

If not, you can email me the script at tamtur@hotmail.com and I'll see if I can fiddle with it.

FF4LIFE posted 05-29- 11:00 PM CT (US)     Click Here to See the Profile for FF4LIFE  Click Here to Email FF4LIFE     
Wow, nice catch on the &rand and &other, can't believe i didn't notice that, foolish...

and wow, that is briliant. So what is brain 14? but yeah, thats good... i could change them to zero too, that would be ok, actualy, then they wouldn't take damage...would they as brain 14?

FF4LIFE posted 05-29- 11:01 PM CT (US)     Click Here to See the Profile for FF4LIFE  Click Here to Email FF4LIFE     
Another thing that would work to label them:
Asign each a variable, or just find the sprite number, and check those already, .... that sounds much more confusing... but we'll see, i think brain 14 will work if they take damage.
Beuc posted 05-30- 09:58 AM CT (US)     Click Here to See the Profile for Beuc  Click Here to Email Beuc     
About SoB source, it's released!
Simon said in May, well he released it in May [May the 30th ;)]
Well, so you'll be able to see how the multiblast works :)
Tamtur posted 05-30- 05:13 PM CT (US)     Click Here to See the Profile for Tamtur  Click Here to Email Tamtur     
Oh, I didn't know that only some brains took damage - but no matter, even if brain 14 doesn't take damage, you can change the brain right after the sprite gets damaged, couldn't you? Or would it erase the memory of hit points?
Tamtur posted 05-30- 05:18 PM CT (US)     Click Here to See the Profile for Tamtur  Click Here to Email Tamtur     
Also - the only problem with using brain 0 as your "holding" brain is if you have any trees or other stationary objects - with brain 0 - around, because then when you go to switch your damaged sprites back to brain 2 or whatever you would change all the other brain zeros too.

That's why I mentioned brain 14. It's just the button brain - if you have the mouse enabled and click on an object with brain 14 it runs the void click ( void ) procedure. If you aren't using the mouse at all other than the startup screen, you won't have any other brain 14's around.

Good luck

Post New Topic  Post Reply
Hop to:


Contact Us | Prowler Productions

Powered by: Ultimate Bulletin Board, Freeware Version 5.10a
Purchase our Licensed Version- which adds many more features!
© Infopop Corporation (formerly Madrona Park, Inc.), 1998 - 2000.