Author Topic: Save additional data for checkpoints  (Read 1386 times)

0 Members and 1 Guest are viewing this topic.

Save additional data for checkpoints
I've run into a problem, maybe you can help me :)

I'm using my method to fill up the bank account as introduced here: https://www.hard-light.net/forums/index.php?topic=93605.0 and I'm using Axems tutorial for checkpoints here: http://wiki.hard-light.net/index.php/Tutorial_-_Mission_Infrastructure

Both of them are working fine alone.

But I don't know how to put them into one mission.

An example:

Mission starts, you have to fight 12 fighters. My counter counts the ships the player killed to pay a specific amount of money at the end of the mission.

After the first wave, the checkpoint saves. but it only saves the data from the ship (hull, shields, weapons, position etc). If I restart and jump to the saved checkpoint (aka stage 2), the number of kills/ the variable that counted the kills does not get transferred with the saved data from the ship (because the script doesn't read this).

Does anyone have an idea how to transfer the information for the kills over with the checkpoint? Because when you start again and jump to the checkpoint aka stage 2, the enemy wings do not appear like intended, but the kill count is still at 0 and so your hard earned money you get at the end of the mission is gone  :mad2:

Any help would be appreciated :)

 

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
Re: Save additional data for checkpoints
Save it to a player persistent variable (if you're in campaign mode). Just be sure to set it up so that the variable zeroes out if the player replays the earlier waves! Otherwise you could just constantly redo those waves to get unlimited money.

 
Re: Save additional data for checkpoints
If saving your bank account is your target, have you tried using campaign- or player-persistent variables? I'm not sure et all because I never used them before (maybe they're wiped if you fail the mission)... it's just an idea, and it would require to put your mission in a campaign-file too...

Dah! Posted too slow...

 

Offline HLD_Prophecy

  • PVD_Hope in a former life
  • 29
Re: Save additional data for checkpoints
Out of curiosity, does this bank account mechanic happen on multiple consecutive missions, that is, the money you earn can accumulate over multiple missions as you get more kills?

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Save additional data for checkpoints
If saving your bank account is your target, have you tried using campaign- or player-persistent variables? I'm not sure et all because I never used them before (maybe they're wiped if you fail the mission)...

To make it clear, campaign-persistent variables return to their state at the start of the mission if you fail, player-persistent ones do not.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 
Re: Save additional data for checkpoints
Out of curiosity, does this bank account mechanic happen on multiple consecutive missions, that is, the money you earn can accumulate over multiple missions as you get more kills?

Yes, indeed. My idea is to let you grind money from mission to mission and every 2-4 missions you can visit the market where you can spend the money on new ships, weapons (if I can get karajormas idea to work) and additional wingmen and capital ships you will need for certain missions.

@ everyone else: thanks for the suggestions, I'l report when I managed to implement these ideas :)

 
Re: Save additional data for checkpoints
Doesn't the save script have functions for saving variables?

 
Re: Save additional data for checkpoints
Well I don't know. But by setting the Variable to Player-persistent and automatically setting it to zero if the mission is restarted and the checkpoint is not chosen, it's working :)

Thanks!