Author Topic: Changing Crosshairs  (Read 3358 times)

BIOHZRD

  • Full Member
  • ***
  • Posts: 5
    • View Profile
    • MPlusStudios.com
Changing Crosshairs
« on: July 31, 2014, 11:50:54 AM »
Hey everyone! Its been a long time,

So, I like to stop in every few months and download the latest version of dim3 and play around. I do this because I am god awful at anything code related and like to try and better myself. Hopefully you all are patient with my ignorant questions  :o

So I am changing the cross hair images for the weapons. First I downloaded the .pngs that I like into Bitmaps->Crosshairs. (Lets use ray_gun.png as an example)
I added
Code: [Select]
<Crosshair name="ray_gun">
<Image file="ray_gun" />
</Crosshair>
to Settings -> Crosshairs.xml

Then I edited Scripts->Weapons->Instagib Ray Gun.js and changed the weap.crosshair.name='xcross'; to weap.crosshair.name='ray_gun';
 
Code: [Select]
weap.crosshair.on=true;
weap.crosshair.type=DIM3_WEAPON_CROSSHAIR_TYPE_BARREL_TRACKING;
weap.crosshair.name='ray_gun';

But no luck. This same process worked on the Assault Rifle, although it is really small and I can't figure out how to change the size :P (png is 64x64 so its not the image)

Hope I explained this correctly, any help would be greatly appreciated!

Love this engine, I feel like its something you can really learn with. Keep up the good work!
Mike
Uhm...I have no idea what I'm doing.

ggadwa

  • Administrator
  • Full Member
  • *****
  • Posts: 201
    • View Profile
    • Klink! Software
Re: Changing Crosshairs
« Reply #1 on: July 31, 2014, 12:23:03 PM »
All the XML stuff should be editable through editor now, so you shouldn't have to mess with the XML anymore.  That should eliminate any errors that come from messing up the XML, and makes sure that all the files are in the right place, so try re-editing that in Editor.

The three properties that control the crosshair size are:

Code: [Select]
weap.crosshair.minSize                 integer; Minimum size of crosshair
weap.crosshair.maxSize                 integer; Maximum size of crosshair
weap.crosshair.distance                integer; Maximum crosshair sizing distance

I'd start with setting minSize/maxSize to something bigger.  The distance thing is how far away something is to start the crosshair growing to the max size from the min, it's kind of tricky math bit so I'd stick with the min/max for now.

[>] Brian

BIOHZRD

  • Full Member
  • ***
  • Posts: 5
    • View Profile
    • MPlusStudios.com
Re: Changing Crosshairs
« Reply #2 on: July 31, 2014, 02:55:15 PM »
Thats awesome! I didn't know the editor could do all that  :D

But I can't seem to find where to apply the crosshairs to the gun, I can add one but not change the gun it works with. Also when I ad new sounds or music to their respective folders they don't show up in the editor.

Mike

Uhm...I have no idea what I'm doing.

ggadwa

  • Administrator
  • Full Member
  • *****
  • Posts: 201
    • View Profile
    • Klink! Software
Re: Changing Crosshairs
« Reply #3 on: August 01, 2014, 06:56:05 PM »
Thats awesome! I didn't know the editor could do all that  :D

But I can't seem to find where to apply the crosshairs to the gun, I can add one but not change the gun it works with. Also when I ad new sounds or music to their respective folders they don't show up in the editor.

Mike

You have to apply them in scripts.  As for things like sounds, there's actually a layer in the XML, so sound files can change without changing their hookup.  This makes it a 2 step process that's a little harder.  Put in the sound, go into editor, add a sound (the plus button) and then hook it up to the file.  The reason for this extra step is so you can replace sound files with different names for ease of editing, but it might be a step too far as I think about it.  It would probably be better to eliminate that abstraction, but I'm not sure what it would break.

[>] Brian

ggadwa

  • Administrator
  • Full Member
  • *****
  • Posts: 201
    • View Profile
    • Klink! Software
Re: Changing Crosshairs
« Reply #4 on: August 04, 2014, 06:31:59 AM »
Actually, I have to take that back.  Some of these systems are older and I need to take a look at them because I haven't in a while as I work on new things.  The abstraction in the XML makes it a 2 step process, but the XML also has things that the files don't have.  For things like Halos (which are just bitmaps) there's their general sizing and distance data, and for things like sounds, there's the general distance/loudness settings.

So, basically, for everything but music, once you drop in a file (like a sound, crosshair, halo, etc) you'll need to go into editor, into setup -> right section and then add it, and hook it up to the file.

[>] Brian

BIOHZRD

  • Full Member
  • ***
  • Posts: 5
    • View Profile
    • MPlusStudios.com
Re: Changing Crosshairs
« Reply #5 on: August 07, 2014, 12:22:46 PM »
Worked, Thank you!  ;D



Uhm...I have no idea what I'm doing.