ID:166044
 
ok i had to re-write my hard drive cause my game i was making somehow acuired a virus,

so now i dont have a source code to get like hp vars and procs and deathcheck and bump attacks from,

sooo, i need to know how to make a var (hp) into Soldiers (war game)

and when you attack (bump mob) their soldiers go down and when soldiers<=0 (something like that)

it makes the d-check (deathcheck) activate therefore spawning them at the spawning point (1,1,1 for now) and they have their soldiers (hp) goes back to the max amount, giving the mob a messege (M << "[usr]'s army has killed your army.") and the usr that killed mob get this message (usr << "Your Army Annialated, and you have [usr.soldiers] soldiers left alive.") something like that,

now i would do this myself but i dont have my old game source to steal coding from (note: the game source was made by me and my brother, no actual stealing involved).

um thanks (if you can help me), and i dont mine if you help me with part of it and someone else does the rest.
mob/var
Health=50
strength=10
defense=5

mob/Bump()
if(istype(/mob))
usr.Attack()


mob/proc/Attack(mob/M in oview(1))
if(M in get_step(src,src.dir))
M.Health-=src.Strength-M.Defense
M.Death()

mob/proc/Death()
if(Health<=0)
M<<"your dead"
M.loc=locate(1,1,1)

Hopefully, you can do the rest.
In response to Dragon_fire6653
Don't try to help people if you can't write correct DM. You're using usr in a proc, which is a big no-no.
In response to Jp
so how would you do it Jp?
In response to VolksBlade
I'd tell you to read the DM guide and figure it out yourself.

Slightly less harsh, you'll want to define a hp variable for a subtype of mob, redefine Bump(), and define a simple procedure to check for death. A basic framework:

mob
soldier
var
hp
attack

Bump(atom/movable/obstacle)
if(istype(obstacle, /mob/soldier))
attack(obstacle)

proc
attack(mob/soldier/m)
m.hp=max(0,m.hp-attack)
m.deathcheck(src)

deathcheck(mob/soldier/killer)
if(hp<=0)
death(killer)

death(mob/killer)
killer << "You killed [src]!"
src << "You were killed by [killer]"


You can expand that significantly, but this is very much basic stuff. You should NOT need someone to write it for you.
In response to Jp
Yes, while it's a no-no, this aspect of it would technically work... Though, a more complex proc call would of course be unpredictable at best with this model.
VolksBlade wrote:
ok i had to re-write my hard drive cause my game i was making somehow acuired a virus,

Games don't get viruses. You don't re-write your hard drive. You reformat hard drives, and your computer got a virus probably because of a website you visited. If it happened at all, that is.

If you just don't know, that's cool too, but read the reference, guide, and any tutorials you can find. Asking questions like this is acceptable in Developer How-To, but I'd definitely reccommend you go through the basics before you try to make something, or ask for help making something.

I dunno, not really flaming you, but just giving you a heads up here, posts like this are flame-bait, if you have problems while learning through the proper channels, feel free to post here, but trust me, simple things like this are easily learnt through the Guide and Reference.
In response to Ter13
i have read the DM guide and tried to understand the DM reference but they are dry and hard to read (plus i have A.D.D. attention defecit disorder or something like that) and it makes it hard for me to concentrate on anything not too interesting, and i had checked out this totally awsome guide by this person and it had a guide for maped games and txt games, i couldent really understand the txt guide one but the maped game guide was totally helpful.
In response to Jp
ok yall dont get the prospect of my game, HP is SOLDIERS, YOU are a DRIFTER till you go to a nation (or state or whatever) and sign up with the USA, Germeny, or France army, then you are using a different icon with the USA, Germeny, or France Flag (made by me personally), now when you bump someone it triggers a battle (not really) but no one can move, both of their SOLDIERS (or HP) go down, the one that attacks loses SOLDIERS (or HP) slower but the little army thats being attacked loses SOLDIERS (or HP) at normal rate (2 per 5 sleep seconds), but you can upgrade your army and when you do this your MONEY goes down and your SOLDIERS (or HP) raises (kinda like money for lvl up), now do you get what i mean? but both of your guyses codings didnt work (and yes i did properly indent it)
In response to Ter13
Ter13 wrote:
Games don't get viruses. You don't re-write your hard drive. You reformat hard drives, and your computer got a virus probably because of a website you visited. If it happened at all, that is.

Typically visiting a Web site isn't what gets you a virus, it's downloading and running a bad file. Of course, if you're using IE, all bets are off.

Lummox JR
In response to Lummox JR
yeah i am using IE, and ive tried the two coding helps of those guys and i indented it right, but it still didnt work, lummox jr, could you try to help me out?
In response to Dragon_fire6653
Just to back up what Jp said, do not post code help to anyone. People have been telling you over and over again not to abuse usr in procs, and you're still doing it. You've consistently posted with the same kinds of problems again and again. You're still at the extreme newbie level here, so you can't offer code help until that changes because it will be useless.

I'd like for you to someday be in a position to help people, because the more experienced programmers are offering help to newbies, the better off everyone will be. But you're not experienced; you've been at this a while, I know, but you haven't learned a thing yet in spite of receiving considerable code help yourself. If you're not learning, you don't know, and if you don't know, you shouldn't try to help. Please return to the desk, grasshopper.

Lummox JR
In response to VolksBlade
VolksBlade wrote:
yeah i am using IE, and ive tried the two coding helps of those guys and i indented it right, but it still didnt work, lummox jr, could you try to help me out?

Well, to clarify right off the bat, Dragon_fire6653 did not help you. He posted bad code.

But what you're asking here is for someone to write your entire attack and death check for you. Uh, why? There are good examples of how to do these things scattered throughout the forums, and plenty are written by decent programmers. (Even if you stumbled onto more rotten code, we could help you fix it.) Heck, read my BYONDscape article on robust programming, and even that will give you some good ideas on how to construct a death check.
Let's go over what you're looking for again:

so now i dont have a source code to get like hp vars and procs and deathcheck and bump attacks from,

Why in the world would you need existing source code as a basis to rewrite the most basic part of a game? Death checks are easy. Attacking can be easy too, depending on the complexity of the game.

sooo, i need to know how to make a var (hp) into Soldiers (war game)

Are you really asking how to make a var? Because if you don't know that, you need to go read the DM Guide (the link is on the left of this page), at least the first few chapters. This is the most basic of the basic things to do.

and when you attack (bump mob) their soldiers go down and when soldiers<=0 (something like that)

You're getting a little confused here. Is the bump affecting individual soldiers, or some cosmic count of total troop strength? Or are you asking how to decrease the number of available soldiers when one dies? If the latter, then that obviously has to take place inside the death check.

it makes the d-check (deathcheck) activate therefore spawning them at the spawning point (1,1,1 for now) and they have their soldiers (hp) goes back to the max amount, giving the mob a messege (M << "[usr]'s army has killed your army.") and the usr that killed mob get this message (usr << "Your Army Annialated, and you have [usr.soldiers] soldiers left alive.") something like that,

I cannot stress this next point enough, so I will downplay it instead.
<font size=+2>Never say "the usr".</font>
This little verbal gaffe has messed up your thinking on the problem. You do not have any such thing as "the usr". You have a user, or more appropriately a player. If the mobs involved aren't directly controlled by players, then you simply have a mob. You have no "the" anything, and you definitely do not have "usr" because no verbs are involved.

For the sake of simplicity, consider usr to be invalid outside of a verb.

As for the rest, there is another point of confusion. Are the mobs respawning, or just dying outright? Pick one. If this is a conquest type of game, then the soldiers should be dying but not respawning. If it's just one-on-one combat or something, then yes, respawn the mobs, but then why are you keeping count of the number of soldiers available? I think you need to clarify whether you're working with an individual mob or a host of them, and what happens at each stage of the game.

Lummox JR
In response to Lummox JR
ok ill try to make this as readable as possible:

you start as a drifter (no army 10 hp)

you go to a nation (USA, Germeny, or France)

you inlist with one of them and your hp raises to 100

you leave the nation area and there are mobs with different nation flags that have to be killed (they re-spawn)

hp is made into soldiers as in as soon as your hp or soldiers run out and you have 0 you die or re-spawn at 1,1,1

soldiers is just another name for your hp or health
In response to VolksBlade
Mine works perfectly, for what it's intended for - that is, forming the basis of this sort of system. You'll have to do the rest yourself. It is not difficult.
In response to Jp
um i already just said I DID IT MYSELF...