Non-threaded

Forums » Writing Workshop » Read Thread

Find proofreaders here, useful resources, and share opinions and advice on story crafting.

Cold Blood

15 years ago

So you might have heard of my story Cold Blood which I announced a few months ago or something. Recently JJJ Pm'd me about my progress and I realized I wasn't very far, so I've been working on it in earnest lately.

I know Rommel will love Cold Blood because it's as realistic a simulation of the Battle of Stalingrad and I can make. Real weapons, real places, etc. Also, I've incorporated a little mini-game for the weapon reloads. That's right. You better know how to use a Mosin-Nagant, or you'll probably get pwned fairly quickly.

Keep in mind, there will be gore, action, and grizzled men in close proximity. Oh, and women. With rifles. It's all as accurate as I could get with my research. Just know the characters are not real, but probably very similar to the soldiers who fought.

Cold Blood

15 years ago

Alright, I have a bit of a problem with my variables. I just don't have a good way to keep track of the ammunition and tell the player with just one variable. So far, this is the idea I have now:

A single variable, Ammunition, shows the player their current ammo supply. It's limit is 250. Then, I have one hidden variable per weapon's magazine. In other words, let's say the player has 250 rounds of ammo, total. That shows up as a variable on the page. The player has four PPS-42 magazines, which hold 35 rounds each, but the player also has fifty-two 5-round stripper clips for his Mosin-Nagant. So that's 140 + 110 = 250. The player sees 250, not the 140 and the 110.

Unfortunately, it's cumbersome and I don't know how to make the Ammuniiton and the weapons' own ammo cooperate. It's sounding more complex than it is, but I just don't know how to get that down into the game.

So I just need some major help for ammunition.

Also, reloading. I have a little mini-game when you reload, where you select certain actions, and if you do the actions in the right order, the weapon will be reloaded properly. Screw up, and you might jam the weapon...or worse, break it. My problem is: let's say you're exchanging fire with an enemy sniper, and you have to reload. When you select the reload link, I want to take the player to a reload screen and its small link tree that's separate from the rest of the game (so I don't have to keep re-writing the same reload mini-game over and over again), and then return the player to the firefight. Or better yet, have it so the enemy sniper might move or something while you're reloading. How do I keep the action going and/or simply return the player to the action after doing the multi-link reloading mini-game?

I have more dilemmas, but I'll post those later.

Cold Blood

15 years ago

I believe Solo's Random Encounter scripting guide could work well here.

Cold Blood

15 years ago
oh wow, this isnt some small problem. this is a big undertaking. The reloading thing is easy, set a random variable for when the player hits reload, and then when the player returns to the battle, the random variable can set off a random event for the sniper. I.e. if 1d10 is the variable, and if the number turns up 7, the sniper moves or something and you pursue down that action sequence. (btw this game sounds epic)


as for the ammo, why not just show the hidden mag variables?

Cold Blood

15 years ago
*i mean the game is a big undertaking

Cold Blood

15 years ago

Thanks for the help and praise.

The problem with the reload sequence is because it's not just snipers you're fighting. You could be fighting indoors against sub-machine gunners or in a large open area against regular riflemen. Since you can pretty much reload on every single page, I need a way to have the reload AT ANY TIME, and then have the formula know where to take me.

But here's why the magazine problem is such a snag: Let's say you've killed a sniper, and you're scaving his body. You pick up 7.92x57mm Mauser ammo, used in the Karabiner 98k. But since you have only a Mosin-Nagant, the player just holds onto the ammo, and can't load his M-N with the 7.92 Mauser ammo. So what I need is a fool-proof way to have a visible variable, called AMMUNITION, as well as a hidden variable, RIFLE792 (the Mauser ammo), both increase by 5. Now, how do I get the RIFLE792 to stop increasing if the AMMUNITION variable reaches the max, even if the RIFLE792 isn't maxed out? That's really the only problem/paranoia I have.

Cold Blood

15 years ago
just set AMMUNITION in your variables menu to have a max 200, therefore it will never display past this, and never hold a value above this

Cold Blood

15 years ago
well you could just have the %LASTPAGEID thing where when your done reloading, the GO BACK link would have this in the script:

$DEST := @P + "%LASTPAGEID"

and %LASTPAGEID was assigned just before you went to reload, where it captured the id of the page you were on before reloading.

Cold Blood

15 years ago

Alright. But this would not allow me to have to combat continue while the player is reloading, correct? Unless it's physically impossible, I really want reloading to not just be a silly gimmick.

Now with the ammo issue, it's not the AMMUNITION variable that's the problem - the thing that concerns me is How do I tell the RIFLE792, SMG762, PISTOL763, etc. variable(s) not to increase when the AMMUNITION variable reaches max?

Cold Blood

15 years ago
ah i see now! this is something you have to do in scripting. Do like a check for the ammunition variable before the hidden variables gain value.

something like

IF (%AMMUNITION + %HIDDEN) > 200 THEN
%SOMEVARIABLE := (%AMUNITION + %HIDDEN) - 200
%HIDDEN := %HIDDEN + %SOMEVARIABLE

the somevariable is just a placeholder for the difference that goes over 200, so that line just gets rid of that difference nad increases to 200.

Also, remember what i said about the random variable event, what happens is there is no way you can have a battle and reload perpetually, however, once the player is done reloading, the battle can continue as if it HAD been going on at the same, the random events you can establish are:

1) nothing had changed
2) the opponent snuck up while reloading adn you die
3) the opponent snuck up behind you and as you finished reloading you noticed and take action
4) the opponent moved to a diff location
5) you took damage

etc... the sky is the limit!

Cold Blood

15 years ago
im a genius, i know....

(and im so humble!) :P

Cold Blood

15 years ago

So this "Somevariable" is set at 200 or whatever, and it's basically AMMUNITION plus all the different ammunitons in the game (RIFLE792, etc.)? Okay...

I don't want to kill the player with chance - you'll be wounded, but can still counter. However you'll have to return to the Tavern and heal, and that only stops bleeding and minor injuries. Anyway, so you're saying that after reloading during combat, a formula would run and take me to random event? Alright. I'd have to implement this formula in every encounter, correct? How would I do that exactly?

 

Thanks so much for your help, Solo! You're a good comrade!

Cold Blood

15 years ago
Actually no, the somevariable just acts as your check for whether adding ONE hidden variable to ammunitionw ill exceed 200. The some variable is the difference between ammunition and ammo pickup. SO lets say you had 190 AMMUNITIOn and you picked up 20 bullets. what would happen is the above code would see that %AMMUNITION + %PICKUP > 200 beacause 190 + 20 = 210 which is > 200.
So it would then:
add the ammunition and pickup, which is 210 and subtract from 200. So leaving 10.

This 10 value, which is stored in some variable is then added to ammunition (190+10 = 200).. You really could skip the some variable step and make a long operation of the task, but i thought it would be simpler as above.

as for the random encounters, read my article. Basically when you come back from reloading, you can do a check on the random variable and if the random variable falls under an "event" you can execute that event.

Cold Blood

15 years ago

Alright, so the extra 10 rounds would remain on the ground, say, for you to pick up later, or is it lost?

And will do. Although it seems tedious, combat sounds fun...

Thanks again, Solo.

Cold Blood

15 years ago
the work will pay off later.

In the code above, the 10 rounds are basically lost, unless you use specific placeholder variables for each ammunition location (so they go back to the same place) and for each specific gun (so it remembers which gun to fill).

so at the end of the code i would write: (and btw, if you dont define your varibales in the variables menu, you can make your own variables in the scripting engine that have no limitiations in terms of # of characters.

%BULLETSFORSNIPERATSNIPERNEST := %SOMEVARIABLE

obviously it doesnt need to be so ambigious, but just showing you that you can make the varaiable that long. And so when you return to the spot, you can do a check on the page as to whether %BULLETSFORSNIPERATSNIPERNEST has a value, and if ammunition is not 200, they can pick up the extra bullets...

Cold Blood

15 years ago

Alright, thanks again.

I've been debating a Speech skill with myself. Should the player be given a skill that they can level up or whatever so they can convince other comrades to do certain actions that might be riskier or convince enemies to surrender or what have you? It could be called Respect or Status or something.

Cold Blood

15 years ago

[EDIT] (Sozz, I'm absent-minded I guess...)

Should I implement this sort of variable? It'd be a chance variable, so I'd need a formula - probably similar to the random encounter formula - to do such a thing.

Cold Blood

15 years ago
Its up to you as to whether you want to do that or not. If you do it then basically your JEDIMINDTRICK variable would have a certain value, and on pages where you can talk with people, you can have hidden links that become active when your mindtrick variable reaches a certain value. when the link becomes active, you can take that riskier approach and initiate a random variable that either makes the risky action successful or failure. and you can have your MINDTRICK variable affect the percentage of success to failure in your chance roll (to make it complicated) or just leave it a random roll...

Cold Blood

15 years ago

Your code will not work, solostrike. It will add the difference between the limit and the amount you would have without the limit to the ammunition, which allows it to go over the limit. It will also decrease the amount of ammunition you have if you already have a low enough amount.

IF %TOTALAMMO + %NEWAMMO > 200 THEN BEGIN
 %WASTEAMMO:= %TOTALAMMO + %NEWAMMO - 200
 %NEWAMMO:= %NEWAMMO - %WASTEAMMO
END
%TOTALAMMO:= %TOTALAMMO + %NEWAMMO
IF %AMMOTYPE=1 THEN %AMMO1:= %AMMO1 + %NEWAMMO
IF %AMMOTYPE=2 THEN %AMMO2:= %AMMO2 + %NEWAMMO
IF %AMMOTYPE=3 THEN %AMMO3:= %AMMO3 + %NEWAMMO

This should work. %TOTALAMMO is the total amount of ammunition you have. %NEWAMMO is the amount of ammunition that was found. %WASTEAMMO is the amount you cannot carry. %AMMOTYPE is the type of ammunition that was found. %AMMO1, %AMMO2, and %AMMO3 are the amounts of ammunition each weapon has.

Please forgive me if I have made a mistake.

Cold Blood

15 years ago
oh damnit, i see it now. yes the above code is bad, kumquats code is nicer :P

sorry anubis.

Cold Blood

15 years ago
omg i have a math exam on friday and i basically just failed at math right there with that code :( ugg.

Cold Blood

15 years ago

SOLOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO!!!!!!!!!1111111111ONE

Moving on, thanks Kumquat? Any other codes that aren't perfect?

Cold Blood

15 years ago
no other codes were given, just concepts... and the concepts are fine :P

Cold Blood

15 years ago
im still a genius btw....

Cold Blood

15 years ago

Sure.

Now that these scripting problems are solved for the most part by you two (thank you), production on Cold Blood will be amazing. Seriously. Featured spot on Modern Adventure here I come.

Cold Blood

15 years ago

NEW QUESTION!

It's not a scripting problem, just a gameplay question.

How should death and respawning work? Should I have checkpoints? Should a death result in returning to the Tavern and losing all progress in the current mission? Should players just have to save on their own?

(BTW, is there a way to restrict the player from saving whenever they want, and instead ONLY allowing them to save at certain points?)

So if you can answer both questions, really, it'd be much appreciated.

Cold Blood

15 years ago
personal opinion: i think players should save on their own, and you should restrict them as to only anubis-specified save locations.

Having said that, to restrict players from saving whenever they want, go in the main game menu (the one wiht the description and maturity level etc.) and there should be an option somewhere there about saving, turn off the user saves. Now the only way that a user can save is if you provide them with a link to a save game page, where they are able to save and then continue the game from the page they left off. (which you get to specifiy.)

Cold Blood

15 years ago
knock off cryptode then! hows this for a deal, if you can knock off cryptode (and im not saying its hard to top), then ill give you my trophy.

Cold Blood

15 years ago

The game is on, my dear Solo! I plan to defeat Cryptode and earn myself a trophy!