Here's the .gmk,
https://dl.dropbox.com/s/lamdb95pz9w3y3n/Gang%20Garrison%202%20INS%20mod%20Expansion.gmk?dl=1Don't bother reading anything after this unless you're a modder or are actually interested in code talk.things you'll have to look out for besides any weapon object changes:
Under Scripts>Graphics there some important things for drawing the HUDs.
drawHealthHud will have all the health bar and secondary bars as well as the text overlay on top. There is already a section for Illusionist in there, and probably doesn't need any changes unless you're changing his energy stuff around based on his different forms.
drawHUDIcons is where all the sprites for the skill HUDs are drawn. There is no section for Illusionist yet, but you can just stick the code in-between Kid and Bo Jackson (to maintain order consistency). I made all the scripts in here on purpose so it would be a lot easier to read and understand. Here are the basic things you'll need to know:
- the
loc variable determines the location of skill icon; it is used in all the scripts to place the sprite evenly. 0 is the furthest to the right, 1 is to the left of it, ... etc.
-
weaponObj is the variable name for
global.myself.object.currentWeapon-
drawSkillIcon draws the actual icon sprite.
argument0 is its location,
argument1 is the sprite name, and
argument2 is the image index. As a general convention, I store all of the skill icons in a single sprite, and then use
loc for both
argument0 and
argument2. However, since you're going to have different Illusionist forms, it's not going to line up perfectly like that. In that case, you can just pass through whatever number (see vault boy, richter).
-
drawSkillTimer draws the transparent timer over top of the icon sprite.
argument0 is its location,
argument1 is the skill's reload alarm, and
argument2 is the skill's reload time. This divides the scalar properly so it displays the timer sprite correctly.
-
drawSkillUnavailable and
drawActiveSkillBorder should be self explanatory. I use the former for when you don't meet a meter or ammo requirement, and the latter for when it is an active skill currently in use.
-
drawHUDBar draws a correctly formatted white-on-black healthbar inside the skill icon.
argument0 is the location and
argument1 is the maximum of whatever you're measuring multiplied by a number so that it equals 100.
- the only thing I didn't make an easy script for is
drawShadowedText. Check the Rebel Scattergun code for the 2x size number for ammo on the bottom right corner, and the Anna primary code for the 1x size number on the top left corner.
drawTooltips draws all the tooltip windows for the HUDs. It uses the
drawToolTipWindow script, which should be easy to understand.
argument0 determines the size of the window; 0 being small and 1 being large (I might make more sizes if necessary).
- for formatting I do this:
"Skill Name##"+controlChr(global.attack)+":#Description can be however long you feel necessary to describe its basic uses##Damage: xx#Reload: xx/sec"
If say for example you use multiple keys for the skill you'd make it look like this:
+controlChr(global.down)+ " + " +controlChr(global.special)+
That's pretty much it for HUD stuff. Maybe someone else interested in gui coding could find this useful.