Jump to content

Battle Script Help


Monk3h

Recommended Posts

Right, i need help with a battle script for my game.

 

Its not going too be too complicated i hope i just need a few ideas on where to start. Ofc if anyone has some spare time on there hands an wishes too help me further that would be great!

 

Basicly im trying to make a battle script for Army vs Army kind of thing. Each each tribe can buy there own troops of diferent verietys and then send them at the other tribe to fight!

 

Each unit type has there own HP and dmg points. but id like for some units to be more efective against certain types of units so people dont just buy loads of the 'best' unit type.

 

I have a table for the troops and there is a row for each type of unit. The feilds in this table are.

 

id, name, type, cost, desciprion, hp, dmg, fire.

 

 

hp = health

 

dmg =  Damage

 

fire = what place it fires in the battle.

 

 

I need my script to select the first unit to fire by its 'fire' then have the dmg done reduce all the units its fireing ats 'hp' over an average. Then update how many units died (if a units hp reaches 0 it dies) then select the second unit to fire and do this over and over untill the last unit has fired. Not untill some one has lost all there units but untill 1 of each unit has had its turn.

 

Any Advice/help? XD

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.