Chaos Project

RPG Maker => RPG Maker Scripts => Script Troubleshooting => Topic started by: Sin86 on June 15, 2012, 11:31:33 am

Title: [Blizz ABS] Moving an enemy/boss to a certain spot of a room?
Post by: Sin86 on June 15, 2012, 11:31:33 am
I'm assuming this can be done with events although I do not know how to do it, that is why I posted this in the Event Request board.

Anyway, is there any kind of way on how you can manipulate an enemy you are fighting against to walk into the center of the room no matter if he's standing on the left, right, up down, etc areas of the room? It's basically like if you want him to execute an attack that requires him to lets say, a powerful strike but he has to be in the center of the room in order to do this special move or activate a switch or something.
Title: Re: [Blizz ABS] Moving an enemy/boss to a certain spot of a room?
Post by: G_G on June 15, 2012, 11:19:22 pm
You'd probably want to use F0's pathfinding script.
http://forum.chaos-project.com/index.php/topic,9784.0.html

Doesn't matter where the event is, if you just enter the coordinates, he'll move there. (Assuming there is a path of course)
Title: Re: [Blizz ABS] Moving an enemy/boss to a certain spot of a room?
Post by: Blizzard on June 16, 2012, 04:06:40 am
Blizz-ABS has an integrated pathfinder (how else could the enemies follow you around?). Just look up the script calls in the manual.
Title: Re: [Blizz ABS] Moving an enemy/boss to a certain spot of a room?
Post by: Sin86 on June 18, 2012, 11:31:13 am
The pathfinder for Blizz ABS only applys to the player and not enemies and ForeverZero's isn't compatible with Blizz ABS, he says that it has possible issues with other scripts that involve a pathfinder.
Title: Re: [Blizz ABS] Moving an enemy/boss to a certain spot of a room?
Post by: Landith on June 18, 2012, 12:13:46 pm
Spoiler: ShowHide
(http://i1070.photobucket.com/albums/u499/Landith1/RTFM.png)
Title: Re: [Blizz ABS] Moving an enemy/boss to a certain spot of a room?
Post by: Sin86 on June 18, 2012, 12:41:47 pm
Yeah, thats what I read. It is talking about the player though and I've tried it out and I only know how to do it on the player but I would like to know how you can do it for enemies to move to the center and not the player.
Title: Re: [Blizz ABS] Moving an enemy/boss to a certain spot of a room?
Post by: Landith on June 18, 2012, 12:44:30 pm
QuoteCHARACTER can be any character, such as an event ($game_map.events[ID]). XCOORDINATE and YCOORDINATE are the coordinates of the map tile that you want to move to.
Title: Re: [Blizz ABS] Moving an enemy/boss to a certain spot of a room?
Post by: Sin86 on June 18, 2012, 12:51:26 pm
Having a bit of a problem with it. I throw in an event with(event 1) to make event 2 move to a certain spot with this script.


"$game_player.path_target_x = ($game_map.events[2])" (without quotes)(game mape events would be CHARACTER) and I get this error message.

Wait, nevermind the error message, I made a typo on the script when I put the script in. However, once again it's only moving the player to the character, which is event 2. I'm trying to make event 2 move, not player move to event 2.
Title: Re: [Blizz ABS] Moving an enemy/boss to a certain spot of a room?
Post by: nathmatt on June 18, 2012, 03:22:49 pm
it would be
$game_map.events[2].path_target_x = the center x
$game_map.events[2].path_target_y = the center y
Title: Re: [Blizz ABS] Moving an enemy/boss to a certain spot of a room?
Post by: Sin86 on June 18, 2012, 07:32:22 pm
Now I get an error.


"NoMethodError occurred while running script.

undefined method `path_target_x=' for#<Game_Event:0x982a7a8>"


I set up 2 script calls, just like how I do on a player(which works on the player) and yet I got the error for the event. I did it like this.

$game_map.events[2].path_target_x = 5
$game_map.events[2].path_target_y = 10

Got the error and I even did it like this.

$game_map.events[2].path_target_x = the center 5
$game_map.events[2].path_target_y = the center 10

Now, if the event happens to be an enemy(which I want the event to be), I do not get the error message. Instead I get no error message but the enemy refuses to walk to those coordinates.
Title: Re: [Blizz ABS] Moving an enemy/boss to a certain spot of a room?
Post by: KK20 on June 18, 2012, 08:18:04 pm
In a script call, use this:
e = $game_map.events[2]
$BlizzABS.AI.request_path(e, 5, 10)
Title: Re: [Blizz ABS] Moving an enemy/boss to a certain spot of a room?
Post by: ForeverZer0 on June 18, 2012, 08:35:56 pm
Moved to Script Troubleshooting since where it belongs.
Title: Re: [Blizz ABS] Moving an enemy/boss to a certain spot of a room?
Post by: Blizzard on June 19, 2012, 02:23:42 am
KK20, you can do that now, too, if the topic is located in one of the boards you moderate. If you notice that a script is in the wrong section, feel free to move it. You should also move script topics into the database if they are using the template properly. You should then check if the topic appears in the script database index.

I forgot to send you a PM with some info about being a mod. I'll get right to it.
Title: Re: [Blizz ABS] Moving an enemy/boss to a certain spot of a room?
Post by: Sin86 on June 19, 2012, 12:19:51 pm
Quote from: KK20 on June 18, 2012, 08:18:04 pm
In a script call, use this:
e = $game_map.events[2]
$BlizzABS.AI.request_path(e, 5, 10)



Thank you, it worked!

However, now I am having another problem. I set the enemy to have a weapon trigger so that script can be called. The script calls fine however, after it reaches it's destination, I want the enemy to activate a switch and other commands and yet when the enemy goes there, nothing happens.

I tried to make an event using variables like how you would when pushing a box onto a switch, didn't work. Tried setting the event to "Event Touch"(both the default way and the trigger), didn't work either unless the player steps onto it, which isn't suppose to happen. Any way on how to make it activate a switch onto it's destination after the enemy reaches it?
Title: Re: [Blizz ABS] Moving an enemy/boss to a certain spot of a room?
Post by: Landith on June 19, 2012, 12:45:36 pm
Parallel Process to check for the event's map x and map y then when they equal that turn on a switch.

Spoiler: ShowHide
(http://i1070.photobucket.com/albums/u499/Landith1/event.png)
Title: Re: [Blizz ABS] Moving an enemy/boss to a certain spot of a room?
Post by: Sin86 on June 19, 2012, 12:49:31 pm
I tried doing that too. It worked on crates and boxes but it did not work on the enemy.

It was almost the exact same way shown in the picture too.
Title: Re: [Blizz ABS] Moving an enemy/boss to a certain spot of a room?
Post by: Sin86 on June 21, 2012, 01:47:10 pm
Is there any way on how I can get an enemy to trigger an event by simply walking on it? I mean we now got a way to set it to where it can walk to anywhere on the map where we want it to but is there a way on how I can make it walk to a certain spot, then an event will trigger? I still tried the variable method like Landith provided and it still didn't work.

I tried this method too.

($game_map.events[1].x == $game_map.events[3].x) and ($game_map.events[1].y == $game_map.events[3].y)


As a parallel process(1 being the enemy, 3 being the event to where it steps on, something should trigger) and it still did not work. Both methods work fine with normal events touching other normal events but the enemy event doesn't seem to be recognized. Any help?
Title: Re: [Blizz ABS] Moving an enemy/boss to a certain spot of a room?
Post by: KK20 on June 21, 2012, 02:23:25 pm
Are you using pixel movement? When I set mine to zero, I was able to use the enemy's (x,y) values to trigger events at certain (x,y) positions. But when I changed it to a one, the enemy couldn't trigger it--this is due to the enemy's coordinates being (10,20) and not logical (5,10).

If you are not using pixel movement, then I have no idea why your enemy is not triggering the events.
Title: Re: [Blizz ABS] Moving an enemy/boss to a certain spot of a room?
Post by: Sin86 on June 22, 2012, 11:54:40 am
Thank you so much for clarifying that to me. Yes I was using Pixel Movement and that is probably why it didn't work and like you said, I switched it to 0 and it worked well.