RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
How would I go about doing this?

0 Members and 2 Guests are viewing this topic.

*
Small Bat Dev
Rep:
Level 76
2012 Best Artistf*ck u >:(2011 Best Artist2010 Best NewbieParticipant - GIAW 11Bronze - GIAW 92011 Most Attractive Female MemberBronze - Game In A Week VII
Hello!

I have been trying to create a hunger system for a project I'm working on. I wanted to make it so there would be a variable that kept track of how hungry you are - something simple like 0-10 = not hungry, 11-20=peckish, etc etc

I was trying to make it so that moving between areas on a map (say through a door) would a 1 point to this, kept track of by a single variable. At around say 50 points out of 100, the character would no longer be able to run. At 90 points out of 100, they would move at an incredibly slow pace. At 100 points, a cutscene would play automatically. Hunger could be "removed" by eating items that changed the variable.

However, I tried doing this with a series of common events + parallel procresses and it was.. it was a mess. If there was a story event on the map, it wouldn't always work. Sometimes it just straight up wouldn't work.

I figure the best way to do this is through a script, as then it would be constantly running throughout the game and would kick in instantly once the requirements were met.

Problem is I'm a novice scripter at best and I couldn't really get my head around how I would do it. Anyone feel like helping?

I figured it would be like this roughly:

>check variable on map load/change
>if under 50, do nothing
>if over 50 then disable running
>if over 90 then half move speed
>if = 100 then transfer to map ###

but part of me thinks thats way too simple and theres something I'm missing here. With it set up around a variable, I could have events and items change that variable and not have to worry about having a parallel process on every map slowing things down/not really working.

This has to be tackled before I can really get on with things beyond graphics so any help would be appreciated.


***
Rep:
Level 84
puking up frothing vitriolic sarcastic spittle
I could write pseudo-eventing for this now, but I'm in work and it'll take me too long. I need to eat during lunch breaks as well! I can look into eventing it when I get home from work, but I don't know how to script so if you really want a script then I won't bother.

I can tell you that your problem with cutscene events is a simple one to solve. Have a second page to the Parallel Process that is "On Hero Touch" and does absolutely nothing. Turn that second page on with a switch. Turn that switch on at the start of any cutscene and off after the cutscene. You don't want cutscene map-changes to affect the hunger variable, and you certainly don't want it triggering in the middle of a cutscene. A lot of Parallel Process-style systems have this problem.

Your bigger problem is going to be timing out cutscenes when you don't know how faster the player will be moving... =P

*
Small Bat Dev
Rep:
Level 76
2012 Best Artistf*ck u >:(2011 Best Artist2010 Best NewbieParticipant - GIAW 11Bronze - GIAW 92011 Most Attractive Female MemberBronze - Game In A Week VII
I could write pseudo-eventing for this now, but I'm in work and it'll take me too long. I need to eat during lunch breaks as well! I can look into eventing it when I get home from work, but I don't know how to script so if you really want a script then I won't bother.

I can tell you that your problem with cutscene events is a simple one to solve. Have a second page to the Parallel Process that is "On Hero Touch" and does absolutely nothing. Turn that second page on with a switch. Turn that switch on at the start of any cutscene and off after the cutscene. You don't want cutscene map-changes to affect the hunger variable, and you certainly don't want it triggering in the middle of a cutscene. A lot of Parallel Process-style systems have this problem.

Your bigger problem is going to be timing out cutscenes when you don't know how faster the player will be moving... =P

Hmm, thank you! Thats another thing I had to think about, but I think I can work around it.


*
Last Stop
Rep:
Level 88
Everyone Off
Secret Santa 2013 ParticipantFor taking arms in the name of your breakfast.Secret Santa 2012 ParticipantSilver - GIAW 10Silver - GIAW 92011 Biggest Drama WhoreBronze - GIAW HalloweenGold - Game In A Week VII
couldn't you just add some events to the map transfers? potentially calling a common event that adds 1 to the global variable and then checks what the number currently is? I don't think you'd need a parallel process then as it would only perform the check each time you transferred zones.

***
Rep:
Level 84
puking up frothing vitriolic sarcastic spittle
couldn't you just add some events to the map transfers? potentially calling a common event that adds 1 to the global variable and then checks what the number currently is? I don't think you'd need a parallel process then as it would only perform the check each time you transferred zones.

You could do it that way: You'd simply call a Common Event that +1s the hunger variable whenever you teleport off a particular map. You'd just have to be sure that you don't call the event and then trigger the "hungry" code when the teleport leads straight into a cutscene on the other side!
« Last Edit: August 20, 2015, 03:10:25 PM by Sated »

*
Small Bat Dev
Rep:
Level 76
2012 Best Artistf*ck u >:(2011 Best Artist2010 Best NewbieParticipant - GIAW 11Bronze - GIAW 92011 Most Attractive Female MemberBronze - Game In A Week VII
couldn't you just add some events to the map transfers? potentially calling a common event that adds 1 to the global variable and then checks what the number currently is? I don't think you'd need a parallel process then as it would only perform the check each time you transferred zones.

You could do it that way: You'd simply call a Common Event that +1s the hunger variable whenever you teleport off a particular map. You'd just have to be sure that you don't call the event and then trigger the "hungry" code when the teleport leads straight into a cutscene on the other side!

See thats not the problem. The problem is having the event that executes the effect based on how hungry the player is. Sometimes, it just doesnt seem to work.

I've got some idea thanks to a bit of help from my friend demi, so heres hoping I can figure it out.