Page 1 of 2

Help Me please?!?

PostPosted: Wed May 12, 2010 7:00 pm
by dyronl
Can you help me? I am attempting to create an RPG. I am an extreme script editing novice however. :cry: I am attempting to create an "attack box" that when the main character enters, the enemy will go towards it. If someone can help me, I would be immensely grateful :mrgreen:

Re: Help Me please?!?

PostPosted: Wed May 12, 2010 8:47 pm
by Hblade
This is a bit advanced, maybe Tutochao's Tutorials can help. It's in general :D

Re: Help Me please?!?

PostPosted: Wed May 12, 2010 8:50 pm
by krenisis
Ok for a beginner an RPG will be very difficult. Follow this an tell me if the effect is what you want.
1) Click on the enemy
2)Click on events / then click on draw actor .
3) Click on action / click on script editor .
4) Now this is the part where you need to focus....Click on variables it should be towards the bottom of screen.
5) Click on the variable / MoveTo / and a box will appear.
6) In the box it will say event actor leave that alone...next it will say relative to ....you click on that and choose the box actor...where it says the 1 erase that and put 5 .
Ok now that should work , please respond after you have done it and give me feedback.

Re: Help Me please?!?

PostPosted: Fri May 14, 2010 7:27 pm
by dyronl
Ok thank you for your answer but this only caused the enemy to move to the edge of the attack box, apparently trying to escape as it rammed repeatedly against the side. My "attack box" is a filled region, could this be part of the problem?

Re: Help Me please?!?

PostPosted: Fri May 14, 2010 9:36 pm
by krenisis
Ok try this
1) make the box smaller
2) Instead of filled use wire frame region
Tell me how this works out.

Re: Help Me please?!?

PostPosted: Fri May 14, 2010 9:39 pm
by krenisis
Or if those 2 dont work just make a regular actor and set the transparency to 0. That will work but after you place it you wont be able to see it so just plan ahead where you want to place it. I listed 3 methods depending on what you want to do.

Re: Help Me please?!?

PostPosted: Sat May 15, 2010 7:35 pm
by lcl
If I understood you right, you are trying to make enemy go towards the main character, like attacking?
I think this will be easy to do with some easy script.

First make variable "move_enemy".

Player -> Collision -> Any side -> Attack Box -> Script Editor
Code: Select all
move_enemy = 1;


And then in Enemy -> Draw Actor -> Script Editor
if (move_enemy == 1)
{
//Add there that Move To function with clicking variables -> Move To -> Event Actor -> Relative to: Player -> velocity: 5
}
Hopefully this helps you! :D

Re: Help Me please?!?

PostPosted: Tue May 18, 2010 7:28 pm
by dyronl
Icl yours worked great! the onluy problem is that it attacks even when the player is no where near the attack box, as soon as the game starts actually.

Re: Help Me please?!?

PostPosted: Tue May 18, 2010 11:25 pm
by Hblade
Make sure you have 2 = signs :3

Re: Help Me please?!?

PostPosted: Wed May 26, 2010 7:24 pm
by dyronl
adde the secon = now it just circles the box and doesn't actually follow the player at any point :|

Re: Help Me please?!?

PostPosted: Wed May 26, 2010 10:54 pm
by edwardfanboy
krenisis wrote:Or if those 2 dont work just make a regular actor and set the transparency to 0. That will work but after you place it you wont be able to see it so just plan ahead where you want to place it. I listed 3 methods depending on what you want to do.


Setting the transparency to 0 will make all collision events stop working.
Best set the transparency to something small but not 0.

Re: Help Me please?!?

PostPosted: Thu May 27, 2010 1:13 am
by DST
If you want something to collide yet be invisible, leave the transparency at 0 and instead use
VisibilityState("Event Actor", DONT_DRAW_ONLY);

That's what VisibilityState() is for - not drawing it at all, but still allowing it to have the full range of functions.

This is better because it will not render the actor, whereas if you have a transp of .99 the actor will still render. It may be invisible to you, because of your monitor settings, but someone with a good monitor will still see it faintly.

There is a huge difference between invisible and .99 transp on a good monitor. Especially against solid colors, and especially against black.

Re: Help Me please?!?

PostPosted: Wed Jun 02, 2010 6:56 pm
by dyronl
DST thanks alote ! :)) that info was very useful as I now have invisible walls which is very good ((:

Icl it'd help lots if you could get back to me, because except for the one error yours seemed to work best, in the mean time I will be trying the last method of Kren and seeing if it worked since the others didn't do much

again, thank you everyone you have been very helpful :D

Re: Help Me please?!?

PostPosted: Fri Jun 04, 2010 12:21 pm
by lcl
Here is example for you, dyronl! :D That allows you make many attacking enemies, without that all the enemies would attack same time... :D
Note that "move_enemy" variable is actor variable, not global. This way every one of the enemies can have own value for it. :D

Re: Help Me please?!?

PostPosted: Fri Jun 04, 2010 6:41 pm
by dyronl
Thanks man that's awesome, I was worried about creating multiple enimies :)

What about a deactivation zone? do you think I could make, say, four small wire frames around the area I want the player chased and set a colision event to set move_to to 0 and then set a script that has the enimies move back to their area ? or would all the enimies swarm the one return area?