Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Bomb Movement (https://forums.graalonline.com/forums/showthread.php?t=42785)

PrinceDark 02-15-2003 09:40 PM

Bomb Movement
 
Ok I tried this offline.
NPC Code:

if(playerenters||timeout){
for(i=0;i<bombscount;i++;){
bombs[i].y+=.4;
}
timeout=.1;
}



It didn't work for me. I was attempting to make a quest where if the player lays a bomb it would begin moving in a certain direction, and I did that above script to test to see if it was possible to actually do this. It didn't work for me. So I then went into the newfeatures2001.txt and it said all those types of variables for bombs[], arrows[], npcs[], etc were all read-only.

Is there any other possible methods of moving a bomb placed by the player or am I missing something that I should add on to this script?

Torankusu 02-15-2003 09:57 PM

You're going to want to make your own bomb NPC for this one.
Using a bomb image as the bomb, and have it scripted to blow up like a bomb after a certain amount of time. To get what you want, you're going to also have to add some script that would get it to move in a certain direction after laid (I would suggest using "move"). Etc.

Pretty easy, actually.

Falcor 02-16-2003 06:11 AM

You could remove the bomb and move it with showimg to where you want, then place the bomb there when its at the destination?

Torankusu 02-16-2003 06:44 AM

Quote:

Originally posted by Falcor
You could remove the bomb and move it with showimg to where you want, then place the bomb there when its at the destination?
I don't think he meant picking where it lays. More like, laying the bomb, and then it starts to move.

I could be wrong, that's just what I interpretted from his post.

PrinceDark 02-16-2003 09:01 AM

My goal was moving it after the player layed the bomb down. I'll figure out another way to do it.
Thanks for the help.

Falcor 02-16-2003 06:30 PM

Toran, you dont understand, the bomb LOOKS like it is moveing when you use showimg, its just not really a bomb anymore.

1. Add the x,y, and power to an array and remove bombs that arent at their destination.
2. use a for-loop to show the bombs at their x,y, with an image based on their power
3. add to their x and y every so often to move them.
4. when they get to their destination, use putbomb, and remove the data from the array.

Torankusu 02-16-2003 08:33 PM

Quote:

Originally posted by Falcor
Toran, you dont understand, the bomb LOOKS like it is moveing when you use showimg, its just not really a bomb anymore.

1. Add the x,y, and power to an array and remove bombs that arent at their destination.
2. use a for-loop to show the bombs at their x,y, with an image based on their power
3. add to their x and y every so often to move them.
4. when they get to their destination, use putbomb, and remove the data from the array.

Hey, yeah, I do understand actually. But I don't see the point when you could code your own bomb NPC and add a lot of improvments to that, compared to a measily showimg eye-trick.

Just making a new bomb NPC seems a lot easier.

Falcor 02-17-2003 04:47 AM

Quote:

Originally posted by Torankusu

Hey, yeah, I do understand actually. But I don't see the point when you could code your own bomb NPC and add a lot of improvments to that, compared to a measily showimg eye-trick.

Just making a new bomb NPC seems a lot easier.

Maybe, Maybe not, it all depends on situation... This meathod would work for all bombs. the other meathod, the bombs would have this code in them, useless code that would only be usefull under this one circumstance.

screen_name 02-17-2003 05:39 AM

Toran, all the kid wants is some eye candy in the first place. Why make it harder than it has to be? He wants a bomb to move from a to b. No need for an entirely new script for it.

Torankusu 02-17-2003 06:05 AM

Quote:

Originally posted by screen_name
Toran, all the kid wants is some eye candy in the first place. Why make it harder than it has to be? He wants a bomb to move from a to b. No need for an entirely new script for it.
I figured a customizable bomb would be more fun.

Dach 02-17-2003 10:10 PM

Just change the bomb npcw for that quest only, then change it back.

screen_name 02-19-2003 09:30 AM

Quote:

Originally posted by Torankusu
I figured a customizable bomb would be more fun.
So you all of a sudden changed your reasoning why he should use a custom bomb?

Torankusu 02-19-2003 02:52 PM

Quote:

Originally posted by screen_name


So you all of a sudden changed your reasoning why he should use a custom bomb?

...Or I gave him another reason why.


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

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