Tower shooting

XGuarden

Veteran
Veteran
Joined
May 10, 2016
Messages
446
Reaction score
17
First Language
French
Primarily Uses
On the map, I want to put tower that will shoot player if he pass in front of him in all 4 direction.


Limitation:


- Player can't move while the animation shoot hi


- Tower will not shoot exceed tile with regionID 250


- Tower will not shoot or freeze player if the placer is protected by some objet.


Curently the main trouble is that in PRG Maker all event was just an event and they are all same when come to compare.


He will not see the the picture is water or picture was a shield, etc...


So what I look for... A way for be able to diferenciate different event in coding.


Curently the best way I found is by using "Comment" not sure for english name, it's the note in the right if the eventname.


But I did't find anyway for get it. Maybe a pluggin...


The second difficulty, it's about speed. 5 tower in the map for 5 parallele event.... no way....


One parallele event the check if the player is on the row of any tower .... maybe... but that will require different coding for each level and it's not how I do things...


Using a parralle event that will activate switch on all tower for them to check if the player is on the row... maybe but I think that will lag...


Do a parralele event that detect if player was on a regionID 248 for exemple and if yes activate tower that will make test or in the other side test


from player to tower to see if he have protection... a little bit better but still...


DId you have any better plan? Thanks for you help.


By the way my game is in great progress and I will do a demo game with different level that all user will be able to use in their own project.


All objet in my game was indefendent to any variable, all with script and ready to go when placed on the map without any paramater need to be done.
 

Astfgl66

Veteran
Veteran
Joined
Jan 5, 2016
Messages
722
Reaction score
578
First Language
French
Primarily Uses
This is very complex and likely impossible to do with eventing, yes even using script calls.


Because you'll have to:

  • Read the comments to see if events are valid targets or towers
  • Make a command to see if they are within range and on your target region + any custom condition
  • Define properly (I mean: in engine understandable terms) what you mean by hidden or protected by another object. This is likely to involve a lot of calculations.
  • Have a way to invoke bullets: maybe by invoking events but that would cause a lot of trouble. Most probably you'll have to invoke sprites, update them and make them move on the map, if you don't want them bound to the grid. You could use pictures maybe.
  • Define what means bullet collidion and handle what happens when they collide

That's just for the very basic functions of a tower defence game.


I'm not sure RPGMaker is best suited for this.


Can it be done? Absolutely, you can make anything you want using javascript.


With eventing? Hell no. Or only with severe limitations.


Now if I misread and you just wanted to zap the player periodically when he is in range/on the same line as a tower, it can be done with eventing.


You don't need to use comments to know what events your turrets are.


Just add the turret events ids into an array and do the checks cycling through that array, in a single parallel process, most likely within a common event. You know their id in editor, which means you don't have to use a comment.


If you're invoking them on the fly, that's another story. You could still do it by adding event ids of newly created turrets to an array, and removing them when you dispose of that turret surely, but I'd start to question doing it with script calls again.
 

Skunk

Melody Master
Veteran
Joined
Mar 2, 2013
Messages
1,069
Reaction score
398
First Language
English/Slavic
Primarily Uses
RMMV
Quasi ABS MIGHT! be able to accomplish this with some serious tinkering lol
 

Faytless

recently unemployed Kung Fu Master
Veteran
Joined
Jan 27, 2013
Messages
244
Reaction score
164
First Language
English
Primarily Uses
N/A
I'm not sure if RPG Maker is the best engine for you to accomplish this.  Its sort of like asking a 92 Mazda Protoge to haul a trailer truck.  You can modify it to do the work,  but why not just use a truck? 
 

XGuarden

Veteran
Veteran
Joined
May 10, 2016
Messages
446
Reaction score
17
First Language
French
Primarily Uses
Not a tower turrent defense game... It's like "  just wanted to zap the player periodically when he is in range/on the same line as a tower "


these tower will never move but I will create other tower that will move so...


Ideally was a pluggin that can tell if they have a event between these two event with a comment "shield".


Maybe if I can get the the image id I can do something too.
 

Astfgl66

Veteran
Veteran
Joined
Jan 5, 2016
Messages
722
Reaction score
578
First Language
French
Primarily Uses
Please try to be more specific next time then ^^.


What you are asking isn't very hard to do.


I trust you know how to calculate a distance in tiles between two objects.


I trust you know how to check if two events are on the same lines.


What you can do is: in a common event.


Have all your turret event ids in an array.


Have all your shield event ids in an array too.


Check if the player is in the same line/around one of the turret event. (By looping through the array)


Check if the coordinates of any of your shield event are between the turret and the player. This is easy for lines, much more complicated if you are talking about range.


"Between" doesn't mean anything for a computer, you must make the calculations yourself. You could do it by checking in a circle around the tower, occulting a piece of the circle behind each event that is a shield, but this becomes quite complicated.


For a line, draw a line on a piece of paper, place three points on it, set an origin and try to formalize how you would do to check with an equation if a point is between two others, and check if it applies for your third point.


If both of those conditions are true:


Play an animation on the player, make your calculations, set a timer on your event tower to prevent it from shooting too soon after, what you want really...


What is problematic is creating bullets, and handling collisions, not checking if an event is in range or on the same line as a turret.
 

XGuarden

Veteran
Veteran
Joined
May 10, 2016
Messages
446
Reaction score
17
First Language
French
Primarily Uses
For tower that can be jsut a animation because it's an instant kill.


Your way will work. But more and more thing that I add and I feal that will be more and more complicated to handle without lagging.


Did they exist a parralele process that will just activate when player move? I can do it with some code, but must have a shorter way.


The real problem with your method, even if it's a nice method it's that I try to make all my code "automatic" , to work just by putting the objet there and


with one common parralele event. Because it's need to get list of eventid, that will remove the "put and play" part of my code. I know it's a little bit... hum you know...


I think I will need to find a pluggin for help me a little bit.
 

Astfgl66

Veteran
Veteran
Joined
Jan 5, 2016
Messages
722
Reaction score
578
First Language
French
Primarily Uses
First: You could have a parallel process that calls a common event on player movement quite easily, but that's just creating another parallel process isn't it?


Second: It can be fully automated.


Just have the first page of your tower/shield events be a parallel process that add their ids to the proper array, activate a self switch and switch to another page of the event.


If you are working with a lot of events, it will create a bit of lag on loading the map, yes, but that mostly takes care of the plug and play part. You'll then just have to clear the arrays each time you enter/leave the map, and turn the tower/shield events self switches off (and that can be automated too, because you know their ids since they are in the arrays).


I'm going to those length to tell you to event it because, as far as I know, no such plugin exists. The reason for that is that what you are asking for isn't as easy as you probably think it is. RPGMaker was created to handle RPGs, not action games...


So, I think that you should try to do it yourself, or be prepared to wait a long time (or, ultimately, do without).


As a rule: if you aren't able to make something and don't want to pay for it, expect to have to do without. Your game probably doesn't depend on it.
 

XGuarden

Veteran
Veteran
Joined
May 10, 2016
Messages
446
Reaction score
17
First Language
French
Primarily Uses
Your method seem great, I will try it, I will google a little bit about adding to array in javascript, but I never think doing it this way.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,047
Members
137,569
Latest member
Shtelsky
Top