Author Topic: Hitmarkers, I can provide a sound and graphic  (Read 4233 times)

I suppose I could do it. I know how to get the texture to download as well.

Cool, thanks.
Just a guess for future reference, but is it because they're not actually directly associated with anything as a datablock/shape/etc. so the game skips them over?

Yeah basically.

I think it's done. I can't test it right now, but you can test it if you know how to package it.

Code: [Select]
datablock particleData(hitMarkerTexture)
{
textureName = "./hitMarker.png";
};

datablock audioProfile(hitMarkerSound)
{
fileName = "./hitMarkerSound.wav";
description = audioClosest3D;
preload = true;
};

package hitMarkers
{
function ProjectileData::damage(%this,%obj,%col,%fade,%pos,%normal)
{
parent::damage(%this,%obj,%col,%fade,%pos,%normal);

if(isObject(%obj.sourceObject.client))
{
%obj.sourceObject.client.centerPrint("<bitmap:add-ons/server_hitmarkers/hitmarker>", 1);
%obj.sourceObject.client.play2D(hitMarkerSound);
}
}
};
activatepackage(hitmarkers);

Just put that into the server.cs of a folder called Server_Hitmarkers in your add-ons folder. Then put the texture and sound in as hitMarker.png and hitMarkerSound.wav
And don't forget a description.txt, it can be empty.
« Last Edit: December 18, 2013, 03:10:31 PM by Pecon »

No dice. Looks right to me, though....
Quote
Loading Add-On: Server_Hitmarkers (CRC:1628934079)
Add-Ons/Server_Hitmarkers/server.cs Line: 15 - Syntax error.
>>> Some error context, with ## on sides of error halt:
atablock particleData(hitMarkerTexture)
{
^textureName = "./hitMarker.png";
};
datablock audioProfile(hitMarkerSound)
{
^fileName = "./hitMarkerSound.wav";
^description = audioClosest3D;
^preload = true;
};
package hitMarkers
{
^ProjectileData:##:##damage(%this,%obj,%col,%fade,%pos,%normal)
^{
^^parent::damage(%this,%obj,%col,%fade,%pos,%normal);
^^
^^if(isObject(%obj.sourceObject.client))
^^{
^^^%obj.sourceObject.client.centerPrint("<bitmap:add-ons/server_hitmarkers/hitmarker>", 1);
^^^%obj.sourceObject.client.play2D(hitMarkerSound);
>>> Error report complete.
ADD-ON "Server_Hitmarkers" CONTAINS SYNTAX ERRORS

I should have seen that. Sorry. Fixed.

Oh, derp, so should I. Alright, trying it now.

Seems to be working, thanks mang. There was a minor issue in that center prints aren't actually perfectly in the center, but I worked around it by just changing the dimensions of the image to put the actual marker in the center.

Would it be alright to release this in add-ons?
« Last Edit: December 18, 2013, 04:08:06 PM by .::Taboo::. »


Swell, I'll throw together a little demo video and do that then. Thanks a bunch then.