 |
Castle Paradox
|
View previous topic :: View next topic |
Author |
Message |
Machu Righter, a person who rights wrongs

Joined: 09 Jul 2003 Posts: 737
|
Posted: Sat May 01, 2004 10:28 am Post subject: wana dem custem batta injins |
|
|
While I'm waiting to be admited to the Plotscripters usergroup (assuming they have a board), I'll see what the general public can do to help me.
A'ight, for those who don't already know, my current project is a Metal Slug fangame that's a turn-based sidescroller. While going through the Hamster Republic links, I found Moogle1's plotscripting page and saw OHRRPGCE Tactics's plotscripts. The ideas presented make sense, but at the top it says he included a battles.hsi, which I assumed allowed him to do all of those stats for allies and enemies and such. This file was not presented in the least, so here's what I want to know: How can I create a way to easily produce more enemies and keep track of their stats? Global variables come to mind, but I'd have to create each stat for each possible enemy on screen and constantly search and assign new enemies an ID so I can reuse the same set of variables. This could get very complicating with many enemies, and if you know anything about Metal Slug, it's the sheer numbers you fight against. I'm pretty good with the Java programing language, and I was hoping I could create "Enemy Objects" that keep a group of stats for each enemy, but I don't know if that's possible with plotscripting, though my problem would be solved if I could. _________________
Code: | [*]That's it
[*]I'm done reasoning with you
[*]Starting now, there's going to be a lot less conversation and a lot more killing |
|
|
Back to top |
|
 |
Flamer The last guy on earth...

Joined: 04 Feb 2003 Posts: 725 Location: New Zealand (newly discovered)
|
Posted: Sun May 02, 2004 2:57 am Post subject: |
|
|
possible... with a ton of "fake" arrays. using global variables and other types of maniipulation.
but this is very tedious and i'm not very good at explaining this concept... it will require you to make tables of enemy stats, and a long line of identifiers... _________________ If we were a pack of dogs, IM would be a grand Hound, CN would be a very ficious little pitball, and Giz...well, it doesn't matter breed he is, he'd still be a bitch
(no offense to anyone that was mentioned) |
|
Back to top |
|
 |
Machu Righter, a person who rights wrongs

Joined: 09 Jul 2003 Posts: 737
|
Posted: Sun May 02, 2004 11:19 am Post subject: |
|
|
Hmm... I think I know what you're talking about. I assume this makes use of the read and write global commands. Having never tried these before, here are my questions:
When using these commands, is every single global variable considered to be part of an array?
Where does the supposed array start? 0 or 1?
Are the IDs in the order the variables are instantiated at the start of the script? _________________
Code: | [*]That's it
[*]I'm done reasoning with you
[*]Starting now, there's going to be a lot less conversation and a lot more killing |
|
|
Back to top |
|
 |
Flamer The last guy on earth...

Joined: 04 Feb 2003 Posts: 725 Location: New Zealand (newly discovered)
|
Posted: Mon May 03, 2004 12:02 am Post subject: |
|
|
well, it requires you to think well ahead on how you're going to distribute your global variables and what variable is represented by what.
here's an example of how i did mine.
Code: | read global(health + 20 * herobyrank(i) ) |
**health is the very first global variable used as "health" and will be the only global variable for "health" to be declared.
**20, means that every 20 global variable after the first global variable is another health stat.
**hero by rank(i) is in a loop (or loops) where it'll read the health of a hero that's stored in a global variable aaccording to his rank.
this method isn't necessary the most efficient way in working with "fake" arrays... because you have to keep track on how each variable you use works. the longest "read global" i've used, had about 3-4 variables inside that global variable ID number.
EDIT: ok, i only answered the first question... here's the rest
the array can start anywhere, can start at global variable 100 or 0.
the IDs are hopefully in the same order as the first "set of fake arrays"
meaning... Code: |
global variable(
0,health1hero
1,str1hero
2,def1hero
...
#10,health2hero
#11,str2hero
#12,def2hero
#these are commented out, else you'll have a lot of "unused" global
#variables, because the compiler can't tell what global variable will be/has
#been used.
) |
hope you understand what i mean  _________________ If we were a pack of dogs, IM would be a grand Hound, CN would be a very ficious little pitball, and Giz...well, it doesn't matter breed he is, he'd still be a bitch
(no offense to anyone that was mentioned) |
|
Back to top |
|
 |
Machu Righter, a person who rights wrongs

Joined: 09 Jul 2003 Posts: 737
|
Posted: Mon May 03, 2004 7:28 am Post subject: |
|
|
Well, the initial question was if all global variables were indexed like an array, and I completely forgot that you assign the id numbers to global variables! Silly me.
So, say an enemy stat (say, NPC reference) is global variable 10, and the enemy health for it is global variable 11. I could say
Code: | read global(10 + 1) |
to get the specific health, eh?
Suppose that each enemy is 10 variables apart (10-19 is first, 20-29 is second, blah); I suppose I can access an enemy's third stat (like damage) with an autonumber script like this:
Code: | read global(enemy * 10 + 2) |
where "enemy" is the script's argument. Enemy 1's damage would be global variable 12, and Enemy 4's damage would be global variable 42. Perhaps the 10 could be a constant like "ESTEP" and 2 could be "DAMAGE". This way, I could say
Code: | read global(enemy * ESTEP + DAMAGE) |
and change the constants if I rearrange the global variables.
If all this stuff I just assumed is correct, then I have the gist of how this works. Thank you! _________________
Code: | [*]That's it
[*]I'm done reasoning with you
[*]Starting now, there's going to be a lot less conversation and a lot more killing |
|
|
Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|