Help me, RPG problems!
Author |
Message |
TokenHerbz
|
Posted: Mon Aug 08, 2005 1:01 am Post subject: Help me, RPG problems! |
|
|
hi... im making an RPG...
And well its really to long to paste here, and its of 2 files, data.t and main.t
Anyways, i put my wepons and armour in an array of backpack for when i buy it... i use another array of boolean to make sure i keep moving in the for statment.
Anyways, i wanted help with this one problem i cant think of how to do it...
Lets say we press 0
it brings us to the invintory... How so i have an option to *Equipt* a certain ewepon?
i have weps do there damage + the base damage + (the random extra bonus damage from levels)
so i wnat only 1 wep equipt at a time, and so, how do i do this?
Also, another problem im running into, how do i make it CLOSE my proogram any time, by pressing Esc
and last but not least!
How do i get the ability to SAVE the game, as ther hero, his level, and all his stuff, save the game... up to 3 characters...
THank you...
Note: If you need to see my code ill post what u need, or all of it if u wish...
Untill next time...
As always,
|
|
|
|
|
|
Sponsor Sponsor
|
|
|
TokenHerbz
|
Posted: Mon Aug 08, 2005 1:04 am Post subject: (No subject) |
|
|
Ah crap... it wasn't loading for a long time, so i clicked STOP, then hit send again after making title shorter, i thought that was the problem,
SORRY FOR DOUBLE POSTING!
Anywho, i dont think its THAT BIG of a deal, so please....
Dont ban me...
Bye
|
|
|
|
|
|
[Gandalf]
|
Posted: Mon Aug 08, 2005 2:17 am Post subject: (No subject) |
|
|
You can zip all the files and then upload them. That way we can easily test it out with your code.
So for equiping, why not just do something like
if keys ('e') then
weapon_equipped := weapon (selected)
end if
that way you can have shield_equipped and otehr stuff like that.
For saving a game, look up file I/O (Input/Output). Have all the info saved into a text file called 'save.txt' or 'save.sav' - whatever you want. Then just read the file for loading.
Basic answer, but you have to give more info. It's also pretty late .
|
|
|
|
|
|
Cervantes
|
Posted: Mon Aug 08, 2005 6:49 am Post subject: (No subject) |
|
|
Equipping weapons depends on how you want your game to work. There are many ways of doing it. You could drag and drop the item. You could have the user type in the name of the item. You could click the item and type "equip weapon". You could click the item and just type "equip" or hit "e", as Gandalf said, and have your program know to equip it as a weapon.
To save your game, you have to write the state of all your variables to a file and then be able to read them back later. If you're using records, you should use read and write, because write allows you to write a whole record to your file with one, single line. With put and get, you'd have to put each field of the record into your file manually, then get each field back manually.
And you won't be banned. I just delete the other post, and no harm is done!
|
|
|
|
|
|
TokenHerbz
|
Posted: Mon Aug 08, 2005 5:58 pm Post subject: (No subject) |
|
|
if i zip it, my files will get scripted... encoded, unreadable..
|
|
|
|
|
|
Delos
|
Posted: Mon Aug 08, 2005 6:25 pm Post subject: (No subject) |
|
|
What are you talking about? Simply place all your files in handy zip file, post 'em up, and we'll be able to look at them (apres downloading, bien tot). I don't possibly see how zipping a .t file and/or any other external files you may be using could corrupt them to an 'unreadable' extent...
|
|
|
|
|
|
[Gandalf]
|
Posted: Mon Aug 08, 2005 8:36 pm Post subject: (No subject) |
|
|
Heh, I think he means that when you open the .zip file in Turing it comes up as something completely different.
You have to unzip the file before reading it again . Right click the file, and click 'extract' or whatever like that pops up.
|
|
|
|
|
|
TokenHerbz
|
Posted: Sat Aug 20, 2005 4:19 pm Post subject: (No subject) |
|
|
ok here, dont fix my code and DL it back to me, but tell me how to go about fixing it...
I also have 1 problem with getting the CUSTOM HERO to change the player.**** stats, so if you want to run it, just % the errors...
Here it is...
Description: |
Ok as i said, put % on the errors..
But help me fix this |
|
Download |
Filename: |
RPG.zip |
Filesize: |
5.28 KB |
Downloaded: |
128 Time(s) |
|
|
|
|
|
|
Sponsor Sponsor
|
|
|
TokenHerbz
|
Posted: Sun Aug 21, 2005 5:22 pm Post subject: (No subject) |
|
|
hmm, i guess ill try to get it own my own then...
|
|
|
|
|
|
[Gandalf]
|
Posted: Sun Aug 21, 2005 6:28 pm Post subject: (No subject) |
|
|
You have to be way more specific. You can't just say, "I want stats - help me". What part of the code do you want help on? Make some code yourself, then I or someone else will help you fix/improve it.
If you post the same thing over and over again, clearly you're getting nowhere and you will make someone mad.
It seems like you have some good code there, just keep trying things out.
|
|
|
|
|
|
TokenHerbz
|
Posted: Tue Aug 23, 2005 4:59 pm Post subject: (No subject) |
|
|
ok well lets start on the part of the user's cutom hero...
I can get the heros stats, 'userpickhealth' / 'userpickstrong' / 'userpickmagic'...
The problem is, i need it in player.****format...
i currently set spicifics of, player.health := 0 (etc for rest) for the custom hero, in my data.t file.
I attempted many ways to change that variable.
Ex.
player.HP := userpickhealth
i ALWAYS get the error, 'userpickhealth' had not been declared, if i declare it, its says its been declared, i just cannot fix that problem...
I will state problem 2 now....
I cann't display my *player.backpack*
code: |
if money < weps.wepcost then
put "You Dont Have Enough"
Input.Pause
cls
exit
else
for i: 1 .. 20 %%Puts purchesd items into array.
if player.bppres(i) = false then
player.bppres(i):= true
money := money - weps.wepcost
player.backpack(i):= weps
cls
exit
end if
end for
put "You baught it."
Input.Pause
exit
end if
|
this is how i attempt to *get* the item into backpack...
i cant display it though, so i cant *eqipt it*
i am working with a cide of somthing like this....
code: |
if ans = 1 then
%loop
% cls
% for i : 1 .. 20
% put player.backpack(i)
% end for
% Input.Pause
%end loop
end if
|
Well i get errors, and errors....
please DL my RPG, and try to help me fix it.
i hope that was more specific...
NOTE
**This is how i get my user custom info**
code: |
Mouse.Where (x, y, button)
Text.Locate (1, 1)
if points = 0 then
exit
end if
if button = 1 then
if x <= 50 and x >= 0 and y >= 160 and y <= 166 then
userpickhealth += 5
points -= 5
delay(200)
end if
if x <= 65 and x >= 0 and y >= 144 and y <= 150 then
userpickstrong += 5
points -= 5
delay(200)
end if
if x <= 40 and x >= 0 and y >= 128 and y <= 134 then
userpickmagic += 5
points -= 5
delay(200)
end if
cls
end if
|
and heres my problem
code: |
%userpickhealth += player.HP
%player.maxHP := userpickhealth
%player.strong := userpickstrong
%player.magic := userpickmagic
|
i need it in player.*** format because its what i use in my code.
EX
code: |
if r = 1 then
put "You Attack 1st"
delay(400)
loop
mons.HP1 := mons.HP1 - player.strong + (player.lvl * 5)
put "You gave ", player.strong, " damage"
delay(400)
if mons.HP1 <= 0 then
put "You slayed the ",mons.name1
delay(400)
put "You gain, ",mons.xp1, " exp"
delay(400)
player.xp := player.xp + mons.xp1
delay(400)
randint(reward,mons.minmon,mons.maxmon)
put "You got ",reward ," money"
money := money + reward
exit
else
player.HP := player.HP - mons.strong1
put "You took ",mons.strong1, " damage"
delay(400)
end if
|
**im going to modify my battle code lots**
and thats why, but im keeping the player...
i call apot previusly set heros like this
code: |
if ans1 = 1 then
player := racelist(1)
elsif ans1 = 2 then
player := racelist(2)
elsif ans1 = 3 then
player := racelist(3)
end if
|
i do the same with my wepons / spells / and armour
those are still being working on...
Anyways, hope this helps you... to help me...
Bye!
|
|
|
|
|
|
|
|