Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Anshinin

#1
I apologize if I seem like I'm wasting you guys time, I'm reading documentation on the scripting language alongside this and trying to learn it the best I can. I think I'll take a bit of time to review over this thread so far and try to understand everything 100% before I move on because I realize my questions aren't improving my understanding and I need to tackle this at a more fundamental level.

I still will keep up with this thread I just don't want to waste your time with simple questions. So basically I won't move on until I'm absolutely clear about what's happening here :P
#2
I'm thinking I would make a struct for weapons in the game, and then have an array set and perhaps one of the values for it could be "equipped" and if it's a 0 it wouldnt be equipped and 1 then it would and display the button if it's equipped? I think logically I could code that.

Also I tried doing that and it's giving me this error.

Code: ags
BattleScript.asc(10): Error (line 10): Type of identifier differs from original declaration


in reference

Code: ags
Button* selectedAttackButton;


In the header

Code: ags
import void selectedAttackButton();
#3
Okay that makes sense, however I'd like to make it so you can equip better weapons as the game proceeds so it wouldn't just be one button with the attack coded in. How could I code it where it detects an item being equipped and factors in that's value for power from my weapons struct to make the damage dealt?

EDIT: Also, would I put the functions for the buttons under the battle script or in the globalscript? Since when it's in the globalscript it's not detecting "selectedAttackButton = control.AsButton;"
#4
Which function would I put that under?
#5
That worked perfectly! Since you said this pick attack is essentially the substitution for Picking the Target, what would I replace this with?

Code: ags
int target = PlayerPicksAttack();


Since this is a button technically and not a int
#6
I had already done that, the only thing I did was place "selectedAttackButton = control;" into the function for my button. I didn't copy the whole function over since the name is different anyway.
#7
I really appreciate all the advice for this, and I'm totally doing my best to figure this out and learn from this. I understand it'll be complex but I also want to make a quality game.

I tried putting that in and it gave me this error.

Code: ags
GlobalScript.asc(729): Error (line 729): Type mismatch: cannot convert 'GUIControl*' to 'Button*'
#8
I'm confused though, how could I get a button to run a script like this if putting it inside of it would make a weird nested function?
#9
As for running the part where you attack, and then your enemy attacks, could I attach that to a button on a battle screen GUI? So it'd run your attack and their attack.
#10
I guess I'm just having a hard time wrapping my head around this, now that this has been set up how is it supposed to display the enemies bodies? And how does it know what XY position they should go to?
#11
How would I call it from a room?
#12
That makes sense, I'm just confused about putting it in the GlobalScript because I don't know how to start the fight sequence so I thought I'd put it in a specific room for the battle, since that's how I did it with GlobalInts but I wanted to get away from that since Snarky said that wouldn't be very efficient.
#13
Okay so I know this is old but Snarky gave me permission (and preferred) that I just post here about it.

I tried putting this all together in a specific room and set up everything in the header but it's giving me an error

Code: ags
room11.asc(33): Error (line 33): Variable 'InitBattle' is already imported


This is the code in the room http://pastebin.com/vxpQDZPB

and this is the header, the only other place InitBattle is mentioned http://pastebin.com/FtJphJzJ

#14
Okay I'm working through reading and understanding that code so I can implement it since that's actually extremely useful to look at! A lot better than some of the examples I've seen digging through the forum.

Some of the features I'm trying to implement in my combat system and just a general idea of how I want it to work is as such.


  • As of right now all battles are 1v1, and will work like minibosses that won't appear after you've defeated them
  • There will be an option to fight with weapons you've found, magic spells which are represented with cards, and a "time manipulator" combo system (i'll explain)
  • You earn experience for individual stats based on usage (e.g. everytime you hit the enemy with a weapon you get +2 attack exp)
  • The magic spells will have a few different usages from basic attacks, summoning companions, or hypnotizing the enemy
  • The "time manipulator" thing is a little complicated but the general idea is being able to save up "time points" by not acting in your turn (hold up to 4 at a time) and then using them for various little things like hitting the enemy multiple times (the idea is that different versions of your character attack from different timelines), "rewinding" to revive yourself, fast forwarding time beyond the enemies turn so they can't hit you, etc etc
    This feature isn't entirely fleshed out yet but the general idea is there.
  • There is also the option to access your inventory for manual healing potions and items to increase your performance in battle
  • Finally an escape option if you need to

The numbers above the health bar are temporary.
#15
I probably wasn't very clear with my last post, excuse me as I was very tired when I wrote that :tongue:

Anyway, for the most part my battles are going to be 1v1 and I wanted the game to know what enemy to attack within the script. I think the solution I've come up with (though untested) is to make a variable for the enemies health in the script when you run an attack, and then in each room declare what that variables respective GlobalVariable is.

So x - 5 would be the enemy taking 5 damage
and in the battle room I would say x = whatever globalvariable the enemies health is being declared as.

I'll look at the source code for those games though since that seems like it'll be useful.
#16
Okay so this has so far gotten me where I want to be with making my weapons and attacks, but the question of attacking the enemies is still something I need help on.

When I activate a spell or weapon, how do I let it know what enemy to attack without having to declare it for each individual enemy? Like I don't want to have to write out what each spell will affect each individual enemy with, and I don't even think that'd work.

So how do I get it to detect there is an enemy to attack when the weapon or spell is selected?
#17
Those arrays seem very helpful and I understand that, however I'd like a little more clarifications on the use of structs.

Where would you put this and how would it be able to execute as a usable weapon item for example, or if I were to use them to make my enemy bank and have the different characteristics of the enemies? I'm just not entirely sure how I'd use it, though I understand what it is doing.
#18
Okay so looking through the forums I've found a lot of posts on the basics of putting these systems together, however I have a few more questions in making the battle system more dynamic.

I have enemy HP set to a specific GlobalVariable and each enemy who has unique health has their own unique variables. When I use attacks they have to subtract the damage dealt minus that particular enemies HP variable.
What I want to know is is it possible to set some one to detect what enemy is in the battle and set the right GlobalVariable accordingly so you don't have to write every individual enemy down and how it gets affected by that item.

I want to set up some sort of base enemy ai system that activates whenever the right GlobalVariable for them is drawn. Like their attack power multiplied by the power of the attack makes them do their attack, and then runs a text display for what attack they used. If they go below a certain health level they'll add new attacks to their possible usage.

I also wanted the ability to during the main gameplay earn some sort of "spell" that lets you summon someone to help you in battle. So I want to know how to add another character to select from for attacking in fights.

My main goal is really just to minimize the amount of code needed to make battles more efficiently, so I just gotta set up rooms with NPCs and the battle system will work universally, alongside some specified attack names and what not. Any way of making this a more fleshed out system that works will would be rly appreciated.
#19


Working on the hexad battle system :cool::cool::cool:
#20
As the updates become more substantial I'd probably do that, it's not a bad idea. I love doing little situation relevant comic panels, even if they're only for a forum.

Also while I'm at it I took a really short video of just showing some stuff in the game, it's nothing much but I just figured I'd show the game actually moving for once. I guess you could call it a teaser?

[embed=640,390]http://www.youtube.com/watch?v=Dl2-2HjLmdI[/embed]

SMF spam blocked by CleanTalk