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 - xerca

#1
There are some lines like this:
Code: AGS
float horizontalcheckx =   float dx = IntToFloat(player.x - cMinotaur.x+z);

Can I ask what "float dx =" part is doing there? Does it do something I'm not aware? Does it even work? Why not just
Code: AGS
float horizontalcheckx = IntToFloat(player.x - cMinotaur.x+z);
?

Also you seem to create the variables "horizontalcheckx", "horizontalchecky", "horizontalcheckdistance" and their vertical counterparts twice. It could be better to declare them once in the beginning.
Your if-else statement logic is a bit weird, too. I think you are doing something like this:
Code: AGS
if(){}
else{
if(){}
else{
if(){}
else{
if(){}}}}

You can do this instead:
Code: AGS

if(){}
else if(){}
else if(){}
else{}

It is neater and probably more foolproof.

But it will still make the minotaur walk horizontally first if it is a good idea, even if going vertically is a better idea. Maybe you could compare horizontal and vertical distances before deciding on the path, and select the one that would be closer. Or you could make it random (like if both going left and going down will make you closer, select one of them randomly) without comparing. This is not necessary but kind of a better way.
(By the way I'm no expert, just saying what I think)
#2
I'm not really sure about this but did you try to "run as administrator"?
#3
Editor Development / Re: AGS Draconian Edition
Fri 06/04/2012 20:56:51
When I skip a cutscene, it plays all the sound effects that would be played in the cutscene at the same time. It is really annoying. I usually compile the game with vanilla AGS after finishing the work as a workaround. But I think it could be something to be fixed.
#4
Quote from: monkey_05_06 on Sun 18/03/2012 01:30:44
Looks like a job for repeatedly_execute and/or repeatedly_execute_always.

If the movement itself is non-blocking then you can do something like this:

Code: ags
function repeatedly_execute()
{
  if ((player.Moving) && (otherConditionsMaybe))
  {
    player.z--; // or change appropriately
  }
}


Keep in mind that repeatedly_execute can exist in any script except room scripts where it must be linked in the room's Events pane, and the default name is "room_RepExec" (you can change that, but the default is different).

The repeatedly_execute_always function works exactly the same way, except it is called during blocking interactions.

Thank you! It works. I put it in the repeatedly_execute_always because its moving was blocking. I also had to do some extra stuff because the z level it is going changes everytime and I couldn't use the "moving" property because of its different moving style. But now it works just as I want.
#5
I have a simple question. I need to move a character from one place to somewhere but at the same time I must change the z position gradually. Because it is going to a lower place. So how can I change its z property without blocking the script, but not in an instant?

I don't want to use y instead and move it normally, because it becomes a big problem both with being wrongly in behind or on front and scaling.
#6
Quote from: Khris on Sun 11/03/2012 16:23:37
Unfortunately no, no full OO yet. You have to use arrays of structs and pass the indexes. It's not as elegant but shouldn't make the code deteriorate into a huge mess either.
Okay, then.
#7
I now finished the system mostly and it works well, thanks to you guys, especially Khris. But lots of time, I needed to use structs as parameters in functions or as pointers but as far as I understand, AGS simply doesn't allow you to do that. (I mean using a struct like it's Character or InventoryItem, etc) Everytime, I worked hard to find a workaround and did things in a different way but it started to get a little messy again and I just can't add some things if I don't use it like that. Is there any way I can do that? Like a module which lets you use structs as pointers? Or maybe I'm missing a simple thing?

It is not necessary but it would definitely make things a LOT easier.
#8
Thank you very much, it works. I actually thought a way checking whether the target is dead but my idea wasn't so good because it made some possibilities more possible than others in some cases. Yours is perfect.
#9
Quote from: Khris on Mon 05/03/2012 18:59:05
Both tracks are from Chrono Cross. :)
I think I remembered that one from Chrono Trigger, the game which I also stole the cooldown-between-turns idea from.

EDIT: I deleted the last question due to remembering something but suddenly I had another one:

I couldn't find a proper way to randomize AI attacks. Let's say there are enemies, or just one enemy and it is its turn to attack. There may be only one oppenent(the player, which is always fighter[0]), there may be two, three or four different opponents to attack. I can theoretically write something that will check every probability like if fighter[0] and fighter[3] is available, select between two numbers and if fighter[0], [2] and [3] is available then select between 3 random numbers, etc. Or I could make it so no matter who the friend is, they are numbered in order so if there are 2 friends there won't be fighter[3] or fighter[4] regardless of who they are and that would simplify the process but I wonder if there is a way to use one general thing for every possibility.
#10
Wow, that looks a lot like the system I made.

I read about creating your own script for organization (and that hierarchy) in the manual before, but never tried it. I didn't know how it would work but now I see it is quite simple. It would be best to do it this time. Most of my old battle code was in a room script, too. But the functions and some variables were defined in the global script.

I liked your way of getting the fighter's data into the battle. I can make something alike.

By the way, I'm sure I heard that winning clip from the last part of the video somewhere.

Thanks, again.
#11
Thanks very much for the speed and quality of your response. I feel like really understood it.(read it 4 times before feeling that way but still I'm happy) As far as I understood, you created a "struct" called "str_enemy" with properties and created 20 examples of that type. So they can all have the same properties with different values. Then you gave values to their properties. I hope I got it right.

But I don't know what you meant by "body". Is it the global script(not the header)? It is like creating variables so I suppose that.

Also you created 20 "enemies" but exported only "enemy" without a number. Does it not matter?

There are also party members fighting with the player and they have properties like HP and name, too. Should they be str_enemy struct type, too or should they have a different type? Thinking there is a bool ".isEnemy", they should be "enemy" too as a type but that just doesn't sound right.

I think of making the party members fight on their own like enemies, so I think I can use the same fighting AI for them. Just having them attack the enemies instead of themselves should work.

By the way, I don't think there would be a fight including more than the player, 3 party members and 4 enemies; so that much flexibility is not necessary - I don't even think that more characters would fit into the screen.

Thanks again for your help, your answer really helped me more than I expected.
#12
I am trying to make a turn based battle for my game. I had actually made one, which works for one enemy (also it included codes to work with at most 4 enemies in a sloppy way, but never tried that) but I wanted to change it so there could be friends fighting besides the player and actually working "more enemies". I looked at my messy pile of code which was written 4 months ago, which has absolutely no comments to help me remember. After reading it all over I remembered what did what but I couldn't improve it. It just doesn't support being helped, so I will just make a new and a better one. I just now tried making something but I couldn't do anything better. I usually solve my problems myself(in a long time) but I don't have enough time to just try and fail.

I don't really want to put the codes here because of their mess, length and foreign languagely named variables and functions. But I'll tell what it did and how it did. I'm not a genius at coding so I need some help improving my coding skill. I don't wish a readily written and working code, I just want to learn better ways of doing things.

In my old system; there was the player, which teleported to the fighting screen when he came close enough to a wandering enemy. The function which teleported them upon being close; labeled the enemy as "enemy1"(which was a global variable). In the room's fade in, the player and the enemy was placed on previously chosen coordinates and according to their "agility" stats, player or the enemy had the first turn. The player had three options: physical attack, magic and nothing. If player did nothing, nothing happened. If he used physical attack, he hopped and attacked the enemy. The damage was determined from player's strength stat, and a random number. Missing and critical hit chances were determined by player's perception and luck stats ,player's close combat skill and a random number. Those were the same for the enemy, too. If the player choosed magic, they saw an inventory and selected the magic they want and used it on the enemy. The damage was determined by the player's intelligence stat and the missing and critical chances by his perception, luck, magic skill and of course a random number. The player and the enemy had health, energy and cooldown bars. When the health is 0, you die. Energy was used for magic. And cooldown is the time you have to wait before attacking. Cooldown was determined by the agility. Whose cooldown becomes 0, has the turn and can attack. This was the feature which seperated the system from absolute turn based fights. At the end of a match, the player gained experience which is collected to level up and then each level he gained points to increase his stats and skills.

Now, what I need help with is having a friend with the player and having more possible enemies. I hate to write the code over and over again for each possibility like 1 enemy, 2 enemies, 3 enemies or 4 enemies and 2 friends, etc... I want to make a code which will work for every combination without problems but I couldn't figure how to do it. I read lots of things about things like arrays or structs, but I couldn't use them which got me to the conclusion that I couldn't actually understand those. Maybe they are just unrelated stuff I misunderstood.
I don't need much help about making things I explained, I can do them well enough. But I can't implement them to a new system with more characters.

I shall appreciate any help.
#13
I use an editted version of Comic Sans as font. I made it a long time ago. If you want, I can upload it and share the link with you. But I don't know if it includes every german character but it does support ü and ö.
#14
Quote from: mode7 on Mon 23/05/2011 19:48:53
Well you could of course flip the sprites beforehand in Photoshop or something
Okay, I'll do this if I can't find any other method. It would take a really long time and would be a waste of memory though. Maybe I can just give up and delete that room..
#15
I read that it needs to be D3D mode for scaling, and I use that. Also I use lots of high resolution sprites, some with alpha blending. Thanks for the advice anyway.
#16
I have a problem with this module. There is a room which has a video as background (and which we don't see the player character). When the player goes into that room and leaves, the flipped sprites become invisible. At first, I didn't understand why the player character becomes invisible while walking but I realised that only the flipped frames are invisible. Is there a solution to this?
#17
Umm.. sorry. I didn't mean to be aggressive. I was angry for another thing when I found the solution and while I was posting it. My brain works the best when I'm angry.
#18
I solved my problem by using a listbox instead of a label. Thanks for nothing btw.
#19
Hi. I created a gui and a label on it so that the text of the label shows what happened. When something happens, the code appends a new sentence in a new line that contains information about what happened in the game, to the text. It works great at first, but when something like eight or nine lines are appended, the label becomes full and those lines stay there. I don't know if more text is written under, because the gui and the label is at the bottom of the screen. I want the first line to be removed when a new thing happens so other lines move to the top and the new sentence is written at the bottom. If possible, I can use another way so that the window will expand with the lines created and the player will be able to scroll up with a button to see the old notifications. I searched both the manual and the forums but I couldn't find anything useful. I would appreciate any help.
#20
This is the most useful module I have ever seen!
SMF spam blocked by CleanTalk