Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

FPSC Classic Scripts / Make mounted machinegun( like MG-42 or Minigun)

Author
Message
Jesper
17
Years of Service
User Offline
Joined: 14th Oct 2007
Location: Hämeenlinna
Posted: 24th Jun 2008 20:11
It's very easy to make mounted machineguns with Fpsc V 1.09.
There is script command PLRFREEZE. First put minigun entity somewhere in your map. Put it's MAIN script this
Dar13
16
Years of Service
User Offline
Joined: 12th May 2008
Location: Microsoft VisualStudio 2010 Professional
Posted: 24th Jun 2008 21:33
plrdrop doesn't work...and where did you get addplr?

I know not what WWIII will be fought but I do know that WWIV will be fought with sticks and stones-Albert Einstein
Opposing force
19
Years of Service
User Offline
Joined: 10th Aug 2005
Location: England
Posted: 24th Jun 2008 22:38
Have you tried to see if this works first?

http://www.freewebs.com/teammegabasic/
For low price FPSC and Dark BASIC media packs.
Hybrid
17
Years of Service
User Offline
Joined: 21st Nov 2007
Location: In the p-block, group 7.
Posted: 25th Jun 2008 01:52 Edited at: 25th Jun 2008 01:52
Here is my try at it. I have tried to make it work right, but I cannot. Can someone please help out and proofread this? Note, you cannot use a gun since they cannot be droped.



Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 25th Jun 2008 03:54
You know, I was about to write a tutorial for this, but then I figured it'd just be easier to Mod FPSC to allow a couple things to make an even better turret system.

Two things would be needed:
1) A script condition to detect which entity the player is looking at/point at.
2) ..... well, I can't think of a number 2, but some more thigns would be helpful to make it more realistic.


For this, I would love to use Errant AI's little robo-tank character entities. That'd be absolutely perfect.


Simply have your script do the following:

- Find out what entity the player is pointing at.
- Set the entities target as the entity that the player is aiming at.
- Now have your entity shoot it. (And rotate to look at it for a better effect. )


TADA!!! Instant buddy control! Now, one thing to ntoe with these guys is.... don't look at them or they will kill themselves. LMAO!


Now, to make some smart buddies, you'll need:
1) A condition to detect if the entity's target is a character or a normal entity.
2) A condition to determine the name of the current target. (Or NOT a certain name)


Now, along with the above script:
- If the targetted entity is NOT named "Buddy" (Or whatever you name your robots) and it is NOT a normal entity (like a little crate or something), then have it shoot.


For this, you'll simply name all of your ALLY characters "Buddy"... or add some more conditions tot he robots so theyd on't shoot any of the ally characters.



Yes, this will require modding to accomplish in the method I have suggested. Yes, it will run smoothly. Yes, you MIGHT be able to do this without modding... but for someone like me and the other modders/DBP programmers, it'd just be plain easier to Mod FPSC to do it rather than work around all of FPSC's limitations.




The one and only,


Whosoever says, "Don't sweat the small stuff," is obviously not a programmer.
xyzz1233
17
Years of Service
User Offline
Joined: 18th Nov 2007
Location:
Posted: 25th Jun 2008 05:55 Edited at: 25th Jun 2008 05:56
What about a different approach? It could be a plaer controlled turret, not an automatic one. Or you could have an entity that moves it's "head," i.e, the gun part left or right a certain mount of degrees when the player is both within a certain distance, and pressing a certain key. Then the entity fires when the player presses it's "fire" key. Here's an example in pseudocode:



It's not the best, but other additions can be made. We could use the camera stuff in Ply's Mod 1.07 to align the camera so that it is facing the direction that the turret is, etc.
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 25th Jun 2008 06:19
Well, if you're using Ply's Mod 1.07, then I'd suggest just removing player control and using the normal keys/mouse to control the turret.

Personally, I'd enjoy having little robot buddies that wouldn't need any outside input in order to function.

What would be even cooler is if we could script weapons to spawn certain entities. Then you could have a glove weapon like in one of the Ratchet and Clank games that let you throw down little robot tanks that assist you and suicide bomb the enemy when they run out of ammo!!!


The one and only,


Whosoever says, "Don't sweat the small stuff," is obviously not a programmer.
xyzz1233
17
Years of Service
User Offline
Joined: 18th Nov 2007
Location:
Posted: 25th Jun 2008 16:48 Edited at: 25th Jun 2008 16:49
Hmm... I like it, but... We need an explode action.
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 25th Jun 2008 20:13
Well, with a tiny bit more modding, you can make explodable characters (like the latest updates have) and just decrease the bot's life by a huge amount to make it explode.


The one and only,


Whosoever says, "Don't sweat the small stuff," is obviously not a programmer.
Dar13
16
Years of Service
User Offline
Joined: 12th May 2008
Location: Microsoft VisualStudio 2010 Professional
Posted: 25th Jun 2008 21:24
that buddy idea reminded me of an RTS type thing...like you point the cursor at an enemy building that spawns enemies and your guys attack the building and eventually destroy it...

I know not what WWIII will be fought but I do know that WWIV will be fought with sticks and stones-Albert Einstein
Hybrid
17
Years of Service
User Offline
Joined: 21st Nov 2007
Location: In the p-block, group 7.
Posted: 26th Jun 2008 23:53
Ply, you have two great concepts that I will get working on right away.

Hybrid
17
Years of Service
User Offline
Joined: 21st Nov 2007
Location: In the p-block, group 7.
Posted: 27th Jun 2008 00:57 Edited at: 27th Jun 2008 03:00
Here is what I have done. It seems like it should work, unless I have made a stupid error, can you guys gelp? I cannot get it to work.



Here is the revised version, not much different, but it is sortof working. It seems to stop at state=1

the path names are right, just putting it in code makes them vanish

Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 27th Jun 2008 01:50
Looking good Hybrid! Much better than Jespers attempt at it.


The one and only,


Whosoever says, "Don't sweat the small stuff," is obviously not a programmer.
Hybrid
17
Years of Service
User Offline
Joined: 21st Nov 2007
Location: In the p-block, group 7.
Posted: 27th Jun 2008 02:47
Do you see anything wrong with it? I cannot get it to work at all


Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 27th Jun 2008 03:38
Well, first off, I don't know of any keys that have a scancode of 92, 97, or 102... I've attached a picture of keyboard scancodes for you to use.

Other than that... are you at least able to get the player unfrozen from the turret?


The one and only,


Whosoever says, "Don't sweat the small stuff," is obviously not a programmer.
Gunn3r
18
Years of Service
User Offline
Joined: 12th Jun 2006
Location: Portland, OR
Posted: 27th Jun 2008 08:57
I don't think you did attach said image, Ply...
It is in the offical FPSC Guide, though.


Gunn3r Games
Hybrid
17
Years of Service
User Offline
Joined: 21st Nov 2007
Location: In the p-block, group 7.
Posted: 27th Jun 2008 18:58 Edited at: 27th Jun 2008 19:01
the scancodes are on the number pad on a 102 key keyboard



For some reason, even moving into state one doesn't work. I think it is in the scancodes.

For reference, here are the scancodes for the 84 key keyboard



Besides that, no, I cannot unlock the player, unless I use... I think your mod. It has PLRFREEZE and PLRUNFREEZE. Right?

Hybrid
17
Years of Service
User Offline
Joined: 21st Nov 2007
Location: In the p-block, group 7.
Posted: 27th Jun 2008 19:51 Edited at: 27th Jun 2008 19:51
this is just a sig test

EDIT: yes, it worked

Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 28th Jun 2008 07:20 Edited at: 28th Jun 2008 07:21
Oops, you're right, gunn3r.

Wow, so absent minded of me to do that, lol.

Here it is:

(BTW, TAB is 15... kinda hard to tell in this pic)




The one and only,


Whosoever says, "Don't sweat the small stuff," is obviously not a programmer.

Attachments

Login to view attachments
Hybrid
17
Years of Service
User Offline
Joined: 21st Nov 2007
Location: In the p-block, group 7.
Posted: 28th Jun 2008 17:08


???

I am from the U.S.A. Are the keyboards in the UK different from here? They must be because your diagram looks so different from mine.

EDIT: Oh, LOL. After carefuly looking at them, they are mostly the same.

Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 29th Jun 2008 02:38
I live in the US.

Just use the diagram I've supplied, it has yet to fail me.


The one and only,


Whosoever says, "Don't sweat the small stuff," is obviously not a programmer.
zeza
16
Years of Service
User Offline
Joined: 27th Jun 2008
Location:
Posted: 29th Jun 2008 16:44
@hybrid

I found something. For plrfreeze, it has to equal either 1 or 0.
Example: plrfreeze=X
0=unfreeze
1=freeze

I got this from the the guide

Login to post a reply

Server time is: 2024-11-24 09:47:27
Your offset time is: 2024-11-24 09:47:27