Author |
Message |
Darkdoom
Joined: Mon Jun 28, 2010 10:06 pm Posts: 461 Location: STEPPING INTO THE RING
|
Small question...
Here is the rundown. I am making a pack of extremely overpowered guns, like a pistol that rips enemies to blood and gore... but can only for 5 shots total, etc. (these will probably just be for personal use, but I might release if people think it is a good idea. I will put a working version up as soon as I can.)
I need a laser guide on a handgun, a red line that extends from a certain point, and ends on contact with another non-null pixel. I have no idea how to do this, and a search does not really help. A code example would be great.
Thanks!
|
Wed Jan 19, 2011 2:02 am |
|
|
Roast Veg
Data Realms Elite
Joined: Tue May 25, 2010 8:27 pm Posts: 4521 Location: Constant motion
|
Re: Small question...
Attach an emitter to the gun that fires invisible MOPixels that have a red glow on them and a tiny impulse limit.
|
Wed Jan 19, 2011 5:40 pm |
|
|
The Fat Sand Rat
Joined: Sun Apr 15, 2007 5:56 am Posts: 1191 Location: outside the shithole called the University in the Forest
|
Re: Small question...
While Roast Veg's idea is good, it may result in something with visible bend in the beam when you move it. I'd look at the code for the Darkstorm sniper rifles, as iirc those have decent laser sights.
Since those only create a dot at the aimpoint, and not a line to it I'm uncertain if they'll be modifiable to the state you want, but they may at least give you a frame of reference.
|
Wed Jan 19, 2011 8:25 pm |
|
|
411570N3
Joined: Wed Jan 07, 2009 10:26 am Posts: 4074 Location: That quaint little British colony down south
|
Re: Small question...
Geti's laser pointer may be something like what you want. A solild, unbroken beam is sort of laggy. If you don't care for messing with Lua, then the emitter method works well enough, but remember to have two emitters pointing both directions, because they won't flip with the gun, if I remember correctly.
|
Wed Jan 19, 2011 10:33 pm |
|
|
Darkdoom
Joined: Mon Jun 28, 2010 10:06 pm Posts: 461 Location: STEPPING INTO THE RING
|
Re: Small question...
Ok, I will ask Geti.
Also, what size is an average ModuleIcon? 30x30? Does it matter?
|
Wed Jan 19, 2011 11:12 pm |
|
|
411570N3
Joined: Wed Jan 07, 2009 10:26 am Posts: 4074 Location: That quaint little British colony down south
|
Re: Small question...
If it's too big it will get scaled. You might want to keep it small to keep the buy menu uncluttered, though.
|
Wed Jan 19, 2011 11:19 pm |
|
|
Darkdoom
Joined: Mon Jun 28, 2010 10:06 pm Posts: 461 Location: STEPPING INTO THE RING
|
Re: Small question...
And another thing... (lol allusion) Can a reload use one sound, or do I have to split the sound into a beginning and end.
|
Thu Jan 20, 2011 1:45 am |
|
|
Lizardheim
DRL Developer
Joined: Fri May 15, 2009 10:29 am Posts: 4107 Location: Russia
|
Re: Small question...
Yeah it can use one sound, but you gotta time it.
|
Thu Jan 20, 2011 1:47 am |
|
|
Darkdoom
Joined: Mon Jun 28, 2010 10:06 pm Posts: 461 Location: STEPPING INTO THE RING
|
Re: Small question...
Would I remove ReloadStartSound or RemoveEndSound?
Reloading is in miliseconds, right? 1000=1sec?
|
Thu Jan 20, 2011 1:49 am |
|
|
Lizardheim
DRL Developer
Joined: Fri May 15, 2009 10:29 am Posts: 4107 Location: Russia
|
Re: Small question...
You remove the reload end.
|
Thu Jan 20, 2011 1:56 am |
|
|
Darkdoom
Joined: Mon Jun 28, 2010 10:06 pm Posts: 461 Location: STEPPING INTO THE RING
|
Re: Small question...
this is strange... I have a basic gun ini, but cc keeps crashing saying error at line 1, it is just AddAmmo = Round. Nothing else anywhere near it could be breaking it as far as I can tell.
What could be wrong? ps, I looked in AbortScreen and such, it DOES say line 1.
|
Thu Jan 20, 2011 2:27 am |
|
|
Roast Veg
Data Realms Elite
Joined: Tue May 25, 2010 8:27 pm Posts: 4521 Location: Constant motion
|
Re: Small question...
Abortscreen jumps in lines of 100, so don't trust that. I would imagine you need to do: Code: ReloadEndSound = None
|
Thu Jan 20, 2011 5:44 pm |
|
|
Lizardheim
DRL Developer
Joined: Fri May 15, 2009 10:29 am Posts: 4107 Location: Russia
|
Re: Small question...
No you just don't define it.
|
Thu Jan 20, 2011 5:50 pm |
|
|
Darkdoom
Joined: Mon Jun 28, 2010 10:06 pm Posts: 461 Location: STEPPING INTO THE RING
|
Re: Small question...
What is strange is that I added a commented line on line 1, and moved AddAmmo down one line. Now it says line 2, but I will look around in the code to see if I have an error somewhere, I dont know where it would be... maybe the mass is too high (is 5 too high for a round, speaking in terms of possibility?)
Also... for sprites, if you have two, it would be like GUN000.bmp or GUN0000.bmp in the sprite call, would you put GUN000.bmp or GUN.bmp? And, do you have to call a certain thing like "OnFire = blah blah blah" to use the 2nd frame? I feel like such a noob D:
|
Fri Jan 21, 2011 12:02 am |
|
|
411570N3
Joined: Wed Jan 07, 2009 10:26 am Posts: 4074 Location: That quaint little British colony down south
|
Re: Small question...
With more than one frame, you give the filepath Sprite.bmp. CC will look for the files Sprite000.bmp, Sprite001.bmp, etc. With one frame, CC will look for the file Sprite.bmp.
|
Fri Jan 21, 2011 3:45 am |
|
|
|