Omnimaga
Calculator Community => TI Calculators => General Calculator Help => Topic started by: Yeong on October 19, 2010, 09:24:45 pm
-
So I'm trying to make BASIC battle engine that monster comes out depends on # of party (max=3)
The turn will be decided by the speed.
I've tried, but I'm stuck.
Can you guys give me general algorithm for it?
-
When you say monster come out does that mean at the very beginning? If so perhaps have a variable that holds the number of people in your party and use that for a loop?
like this?
(Number of people in your party)->B
For(A,B,1,-1
randint(1,(however many enemies you plan on))->C
If C=1
Theh
output(your choice,your choice+A,"enemy character"
enemy HP -> variable that holds the enemies hp
End
If C=2
"and so on"
That should display the enemies, you just have to add in numbers, thats just the beginning though.
-
thnx!
-
I'm actually working on a very complex RPG that I believe follows some of these guildlines. If you wish, I can post the battle engine's code in its current state for you to look at (though keep in mind it's a work in progress. :) )
http://www.omnimaga.org/index.php?board=63.0 I suggest looking at the screenshot thread. ;D
-
Ah! My computer froze trying to view the screenshots! :o
-
I'm actually working on a very complex RPG
I'M glad to see that in present tense, since it means it's still alive ;D
-
One more question:
I got stuck where speed decides the turn.
it was no problem with 1v1 (Max())
but, is there any less-bytes-consuming way to decide who go first?(Speed-based)
-
It depends, is it kinda semi real-time, where you can sometimes attack twice in one turn if your speed is very high, or is it more like the old FF games?
-
It depends, is it kinda semi real-time, where you can sometimes attack twice in one turn if your speed is very high, or is it more like the old FF games?
No.. Speed is just used for turn
-
Well I don't know an easy way to figure out who goes first, but after that you could put the order in a list and use that to decide the battle cycle.
-
One more question:
I got stuck where speed decides the turn.
it was no problem with 1v1 (Max())
but, is there any less-bytes-consuming way to decide who go first?(Speed-based)
Whoever has the higher speed goes first. If there's a tie, then pick the first person.
For example, in Axe
100->A
102->B
If A≠B
If A>B
First player attack
Else
Second Player attack
End
Else
First player attack
End
This could be done very efficiently in Assembly.
-
i meant 2v2 or 3v3
-
Here, this may help:
Find the element in L1 that's the smallest (defaults to the biggest element number in case of tie):
max((L1=min(L1))cumSum(binomcdf(dim(L1)-1,0
Find the element in L1 that's the biggest (defaults to the biggest element number in case of tie):
max((L1=max(L1))cumSum(binomcdf(dim(L1)-1,0
Ex:
{6,4,6,78,4,9001
max((Ans=min(Ans))cumSum(binomcdf(dim(Ans)-1,0
Would return 5
{6,4,6,78,4,9001
max((Ans=max(Ans))cumSum(binomcdf(5,0
Would return 6
I hope this helps! ;D
-
thanks again!
-
I'm actually working on a very complex RPG
I'M glad to see that in present tense, since it means it's still alive ;D
It's in progress, but I want to finish Exodus before starting work on it again. They conflict too much to be worked on together easily. ;D
thanks again!
Cool, I hope you got it to work. :D
-
Yeah I hope you finish Exodus soon. I hope it gets released for Christmas at least ;D