Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (ozgur, TipmyPip), 722 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, howardR, 11honza11, ccorrea, sakolin
19047 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 3 1 2 3
Re: Level Repeats? [Re: Siwler] #396057
03/02/12 01:14
03/02/12 01:14
Joined: Jun 2004
Posts: 2,234
Wisconsin USA
FoxHound Offline
Expert
FoxHound  Offline
Expert

Joined: Jun 2004
Posts: 2,234
Wisconsin USA
Var isbigbadmonster1killed =0;

......

Now after the while(health >0) loop put

Isbigbadmonster1killed =1;

Now put this at the Start of the function

If(isbigbadmonster1killed ==1)ent_remove(me);

Game_save will save these vars so that is not a problem but it can't save what was done in a level unless there is something to save.


---------------------
There is no signature here.


QUIT LOOKING FOR ONE!
Re: Level Repeats? [Re: FoxHound] #396059
03/02/12 01:30
03/02/12 01:30
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
I don't get your point here, FoxHound. If you load level X and bigbadmonster gets killed and removed, then it will not be there even if you do a savegame, load another level and load the savegame later on. Why making it so complicated with additional variables and script effort?


Always learn from history, to be sure you make the same mistakes again...
Re: Level Repeats? [Re: Uhrwerk] #396062
03/02/12 04:47
03/02/12 04:47
Joined: Jun 2004
Posts: 2,234
Wisconsin USA
FoxHound Offline
Expert
FoxHound  Offline
Expert

Joined: Jun 2004
Posts: 2,234
Wisconsin USA
Siwler is setting his levels up in wed where he also sets up the monsters and attaches the script. So when he kills a monster and leaves a level and comes back then the monster would be back no matter how many times it was killed. My way sets it up to check to see if he was killed before, and now that I am at a computer and not an iphone i can write it out a bit better

var monster_1_alive = 1;

function monster_1_function()
{
//if i am dead then what am i doing here?
if(monster_1_alive == 0)
ent_remove(me);

//i guess im alive so i should have some health
my.health = 100;

//while i have that health i should hang around
while(my.health > 0
{

wait(1);
}

//guess i'm dead now
monster_1_alive = 0;

//goood bye cruel world
ent_remove(me);
}


---------------------
There is no signature here.


QUIT LOOKING FOR ONE!
Re: Level Repeats? [Re: FoxHound] #396076
03/02/12 12:42
03/02/12 12:42
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
Originally Posted By: FoxHound
So when he kills a monster and leaves a level and comes back then the monster would be back no matter how many times it was killed.

That is the point I don't understand because from my point of view this is simply not true. If you remove an entity X from a level, do a save game and later on load that savegame entity X will still be gone.


Always learn from history, to be sure you make the same mistakes again...
Re: Level Repeats? [Re: Uhrwerk] #396093
03/02/12 16:54
03/02/12 16:54
Joined: Jun 2004
Posts: 2,234
Wisconsin USA
FoxHound Offline
Expert
FoxHound  Offline
Expert

Joined: Jun 2004
Posts: 2,234
Wisconsin USA
Correct, as long as you do not reload that level. Once you reload that level it will be exactly as it was the first time.

So kill all the monsters in a level, go to the next level and then go back all those monsters will be there because you are loading a level with monsters in them. Now if you had one giant level and never used level_load then you would not have to worry about that.


---------------------
There is no signature here.


QUIT LOOKING FOR ONE!
Re: Level Repeats? [Re: FoxHound] #396124
03/02/12 23:42
03/02/12 23:42
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
I still think you didn't my suggestion. For every level you attempt to load first try to load a savegame for that level. If and only if loading a save game for that level fails then load the original level.

When you reload the level it will of cause be in it's initial state. The point is avoiding reloading by doing savegames when leaving the level and doing a game load instead of level loading when reentering the level.


Always learn from history, to be sure you make the same mistakes again...
Re: Level Repeats? [Re: Uhrwerk] #396138
03/03/12 04:47
03/03/12 04:47
Joined: Nov 2009
Posts: 70
Siwler Offline OP
Junior Member
Siwler  Offline OP
Junior Member

Joined: Nov 2009
Posts: 70
Game_save and game_load its not working for when going back and fort between levels, here is why:

I'm in level 1 right now and I kill 5 main monsters then collect $500. From this point I can go to level 2 so I can kill more monsters collect more money and get better weapons.
So before I leave level 1 I game_save level 1 then load level 2 right? Now I kill 5 monsters collect another $500, now I have $1,000 and I have to go back to level 1, before I leave level 2 I have to save level 2 and then game_load level 1, sense I have to game_save all my progress under same string name and game_load from the same .SAV file I never leave level 2 it sends me to a loop, which is game_save before leaving level 2 then game_load from the same saved file which was last saved in level 2 it always game_loads me back to level 2 again and again?

But when I game_save and game_load under different .SAV name for level 1 and level 2 then I can't bring anything back from level 2 to level 1, because of saving and loading level 1 under different name.

I do appreciate you guys trying to help me out I have learned a lot from this.


Honesty will get you far, were dishonesty will get you only so far in life.

Re: Level Repeats? [Re: Siwler] #396158
03/03/12 15:02
03/03/12 15:02
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
The basic idea is to have one save game per level. For instance if you have the levels cave.wmb, dungeon.wmb and town.wmb, then you should do three save games as well. cave0.sav when leaving cave.wmb, dungeon0.sav for dungeon.wmb etc.

Additionally to that you should save things like the player inventory, his stats etc. in an external file. Alternatively you can use info variables for this and use the save game mechanism for that as well.


Always learn from history, to be sure you make the same mistakes again...
Re: Level Repeats? [Re: Uhrwerk] #396184
03/03/12 18:59
03/03/12 18:59
Joined: Jun 2004
Posts: 2,234
Wisconsin USA
FoxHound Offline
Expert
FoxHound  Offline
Expert

Joined: Jun 2004
Posts: 2,234
Wisconsin USA
YOur idea is that it's better to have one save file per level plus one save file per game? That doesnt work on levels that need to change. Such as summer and winter levels or I'd you can enter a level from multiple points on top of the fact of how many levels you could have in game.


---------------------
There is no signature here.


QUIT LOOKING FOR ONE!
Re: Level Repeats? [Re: FoxHound] #396188
03/03/12 19:37
03/03/12 19:37
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
If you have different versions of the .wmb files like summer or winter then it gets difficult, yes. Entering a level from several different positions is easy though. First load the game or level, then set the player to the desired position.

The advantage of my solution over yours is that it is generic. Once you realised it is done you don't need to bother about the issue any more. Your approach will generate work for every level and almost every actor inside the game world.

The advantage of your method is of cause the plus on felxibility you gain.


Always learn from history, to be sure you make the same mistakes again...
Page 2 of 3 1 2 3

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