problems with scripts.

fritiof
21 Jul 2011, 00:17
Hi guys this is me again and Iv'e got a question for ya! In my example I walk up the steps of a stair and a dog lunges at me. Now I have two questions for my extremely simple "combat system" First: how do i set a health meter for the dog? It doesn't have to be shown in game but it shoul be there. Lets say i atttack the dog and do 5 damage to it but it doesn't die. But when 15 damage of the dog has been drained by me attacking it 3 times it should die. How do I that?

Second question: Back at the dog example, I have earlier had the possibility to pick up a chair leg as a weapon, how do i make it so that if I type "attack dog" when I have the chair leg I would do double damage to it? Or even set a different script to the dog when I have the chair leg in compare when I do have it?

Please do not call me stupid, be rude or insult me in any way because it's just a waste of both of our times. Please answer detailed and preferrably in steps so it gets easier for me to understand. And don't use some advanced terms I would not understand.

Be`ric Gre`
21 Jul 2011, 00:33
I think you should be able to set up a different status variable for the Dog's health. Name it "Dog Health", and then give it 15 as its initial value. In the Display, type in "health: !". Then set up a script for when the dog reaches 0 health (he dies; object terminated). For the damage variable, you might need to set a script for damage that allows the "Dog Health" to decrement. This is a learning experience for me as well, so if that works let me know. If it doesn't, then I am still curious on how to work this script.

Be`ric Gre`
21 Jul 2011, 00:36
As far as I understand, for the attacking with weapon: You do exactly that as a "verb" that you type in for the "chair leg". So you go to the "chair leg" object, go down to verbs, and enter the verb "attack". Then there will be an option of setting up a script with that verb. If you put it into turns of damage, I believe you can set up a damage mechanic that will allow you to damage the dog's health. Same thing for this. I hope it works, if not... I'm curious as usual. :)

fritiof
02 Aug 2011, 16:08
Well.............that didn't really work. There is no way of making the dog die when "Dog health!" gets depleted to zero, at least none I can find, neither can I attach a verb to the chair leg which is "attack" because that would make me attack the chair leg silly :P. I have found another combat system that doesn't involve hit points for my enemies, instead I make it so that I unlock commands, so if I use "shoot with revolver, I miss, the opopnent attacks me and I tell the player that "shoot shoulder" is a verb that will continue the battle, I find this new combat system more comforting and I actually understand how to make it, so that's allright.

BUT NOW I HAVE A NEW QUESTION :D.

I find a revolver in the guest room, it's emptied and if I typed "shoot enemy" it just says the gun is empty. But: I find a couple of bullets in the basement to load the gun with. Now, my question is: How do I make it so that when I type "take bullets" when im in the basement, my object "revolver" would now be able to damage oponents, now that it's loaded? but that it is't able to shoot before i have picked up the bullets. My second question is: How do I make it so that I find 2 bullets, and when I have used the verb "shoot two times. I can no longer use that verb until I find more bullets?

Please do not be rude towards me or insult me, because you will just waste both of our times. Please explain your answer detailed and in steps, so I understand what you are saying. Please do not use any advanced terms, because you can be suree that I won't understand you if you do.

RedTulip
05 Aug 2011, 00:50
You could add an conditional script that checks whether or not the player has the bullets. Or, you can change the script of taking the bullets, maybe that adds, say, 3 to a number variable called 'bullets'.

And whenever the player types 'shoot enemy', this decreases 1 from the bullets variable. If the bullets variable is 0, that means the gun is empty. Then, the player would have to get some more bullets.

fritiof
05 Aug 2011, 14:26
I don't quite understand, explain in steps and no complicated terms please :P