Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, dr_panther, Quad), 935 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rating: 5
Page 5 of 6 1 2 3 4 5 6
Re: Nighthawk RPG template for lite-C [Re: paracharlie] #282053
07/30/09 04:35
07/30/09 04:35
Joined: Feb 2009
Posts: 84
Deutschland/Niedersachsen
GorNaKosh Offline
Junior Member
GorNaKosh  Offline
Junior Member

Joined: Feb 2009
Posts: 84
Deutschland/Niedersachsen
Now it's gonna be interessting ^^ I was wondering why I couldn't find any code using add_struct in your new itemsystem. That's why I asked the saving-question.

Saving structs seems not to be a problem. You have some itemcreate-function where you malloc the struct: This could be a place for add_struct. A disadvantage is if those added items doesn't exists anymore when saving the game. To solve this you could implement an array or a motherstruct which manages the items an saves all pointers to existing ones. When the user saves the game you have to use add_struct for all these struct-pointers.
But loading structs is mystery for my as well. Don't get where the data could be after loading or meet some errors like "Couldn't load xyz.sav".

Re: Nighthawk RPG template for lite-C [Re: GorNaKosh] #282167
07/30/09 15:53
07/30/09 15:53
Joined: Mar 2009
Posts: 146
USA
P
paracharlie Offline
Member
paracharlie  Offline
Member
P

Joined: Mar 2009
Posts: 146
USA
After doing these add_structs I still have a showdescription error in inventory and equipment. Not sure where to place those or what to use as the void* data that the add_struct calls for. Here is what I have done so far and not sure if these are even correct.

add_struct(NHAC_CINVENT_CELLS[NHAC_CINVCELLS], sizeof(RPGItem));
add_struct(NHAC_CINVENT_EQUIP[NHAC_CINVCELLS], sizeof(RPGItem));
add_struct(NHAC_MOUSEITEM, sizeof(RPGItem));


A8 Commercial
Re: Nighthawk RPG template for lite-C [Re: paracharlie] #282201
07/30/09 18:32
07/30/09 18:32
Joined: May 2004
Posts: 1,510
Denmark
Claus_N Offline
Serious User
Happy Birthday Claus_N  Offline
Serious User

Joined: May 2004
Posts: 1,510
Denmark
Originally Posted By: paracharlie
After doing these add_structs I still have a showdescription error in inventory and equipment. Not sure where to place those or what to use as the void* data that the add_struct calls for. Here is what I have done so far and not sure if these are even correct.

add_struct(NHAC_CINVENT_CELLS[NHAC_CINVCELLS], sizeof(RPGItem));
add_struct(NHAC_CINVENT_EQUIP[NHAC_CINVCELLS], sizeof(RPGItem));
add_struct(NHAC_MOUSEITEM, sizeof(RPGItem));


Try this instead to get the correct memory areas smile

Code:
add_struct(NHAC_CINVENT_CELLS, sizeof(RPGItem)*NHAC_CINVCELLS);
add_struct(NHAC_CINVENT_EQUIP, sizeof(RPGItem)*3);
add_struct(NHAC_MOUSEITEM, sizeof(RPGItem));



However this won't do, as it will not save items dropped on the ground frown

Re: Nighthawk RPG template for lite-C [Re: Claus_N] #282264
07/31/09 01:03
07/31/09 01:03
Joined: Mar 2009
Posts: 146
USA
P
paracharlie Offline
Member
paracharlie  Offline
Member
P

Joined: Mar 2009
Posts: 146
USA
Yeah I dont know. This is little bit beyond my ability and kinda frustrating. I was planning on doing structs for character stats, monster stats and combat tables but now I might rethink it all unless I can figure it out.


A8 Commercial
Re: Nighthawk RPG template for lite-C [Re: paracharlie] #282270
07/31/09 04:18
07/31/09 04:18
Joined: Feb 2009
Posts: 84
Deutschland/Niedersachsen
GorNaKosh Offline
Junior Member
GorNaKosh  Offline
Junior Member

Joined: Feb 2009
Posts: 84
Deutschland/Niedersachsen
Items on the ground exists as ENTITY in the level - Entities could save by the normal game_save() function. You need only a code in the action which cretae a new struct for this item after loading the game and maybe register this struct to your item-management-system if necessary.
Have your get the save and load of the item-structs in the inventory worked?

Re: Nighthawk RPG template for lite-C [Re: GorNaKosh] #282326
07/31/09 10:26
07/31/09 10:26
Joined: May 2004
Posts: 1,510
Denmark
Claus_N Offline
Serious User
Happy Birthday Claus_N  Offline
Serious User

Joined: May 2004
Posts: 1,510
Denmark
I think that the best way would be to put all struct instances into a linked list, to easily iterate through them and make sure that all items are saved.

About the items on the ground - those entities got the address of an RPGItem instance, and that address might not be valid after a game_load. Another option is to remove the RPGItem-instance when an item is dropped on the ground, and then store the item stats in the skills of the entity (and then re-create the RPGItem instance when the item is picked up).

However, it would be very nice if struct-instances in Lite-C was saved automatically - I'll suggest that in the "The Future" forum smile

Last edited by Claus_N; 07/31/09 10:27.
Re: Nighthawk RPG template for lite-C [Re: Claus_N] #282943
08/04/09 18:09
08/04/09 18:09
Joined: Mar 2009
Posts: 146
USA
P
paracharlie Offline
Member
paracharlie  Offline
Member
P

Joined: Mar 2009
Posts: 146
USA
@Claus,
I was thinking since the members of the data structure only exist during runtime that maybe they should be saved to a file. I found similar in aum 83 and aum 69. If they were saved to like a *.ini file then they could be read anytime and none of the information would be lost. The thing is that your template is alot of code and every instance would have to be found and then read from a file.

I'm still at the artwork stage of my game and unfortunately I dont have the time to help.


A8 Commercial
Re: Nighthawk RPG template for lite-C [Re: paracharlie] #282964
08/04/09 21:54
08/04/09 21:54
Joined: May 2004
Posts: 1,510
Denmark
Claus_N Offline
Serious User
Happy Birthday Claus_N  Offline
Serious User

Joined: May 2004
Posts: 1,510
Denmark
Saving it in a separate file would no doubt be the best, but such things as items lying on the ground does complicate it a bit.

I'm currently trying to get a project done in time for the shader contest (and I'm quite a noob at shaders, so it really takes some time :P), and my summer holidays are over when I'm done with that, so I don't know when I'll have time to see to this frown

Re: Nighthawk RPG template for lite-C [Re: Claus_N] #335542
07/29/10 04:52
07/29/10 04:52
Joined: Sep 2005
Posts: 508
Texas
not_me Offline
User
not_me  Offline
User

Joined: Sep 2005
Posts: 508
Texas
can someone post a new link for this? it seems that its inaccessible on the nighthawk website frown

thanks in advanced


-Initiate Games
-Level designer

http://www.sckratchmagazine.com
Re: Nighthawk RPG template for lite-C [Re: not_me] #444521
08/13/14 12:41
08/13/14 12:41
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Is there anyone who still has this OLD template on it's HDD? I would be grateful.


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Page 5 of 6 1 2 3 4 5 6

Moderated by  adoado, checkbutton, mk_1, Perro 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1