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 / Adding a body armour option to an entity?

Author
Message
Runiker
15
Years of Service
User Offline
Joined: 22nd Jan 2009
Location:
Posted: 30th Jan 2009 01:40
Hello i looked and looked and loikked some more into making an entety that needs to be killed with a particular weapon. Also was wondering if there was a way to make armour for the player that they can switch between them and take less damage from diffrent weapons. i dont need sombody to code it just an idea of how to work this in if at all.
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 31st Jan 2009 02:53
Quote: "i looked and looked and loikked some more"


Apparently you didn't look very hard at all considering this was on the first page of this board.

Body Armour Script by Conjured Entertainment:
http://forum.thegamecreators.com/?m=forum_view&t=143609&b=23


Welcome to the forums!


The one and only,


dumpus
16
Years of Service
User Offline
Joined: 1st Jan 2008
Location: Canada, eh?
Posted: 31st Jan 2009 16:50
He still doesn't know how to kill an enemy with a particular weapon, though.

(and neither do I)

Perhaps with some sort of variables?

*This post will self-destruct in 10 seconds.*
Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 31st Jan 2009 17:58 Edited at: 31st Jan 2009 18:10
You could use a global variable as a flag to determine when the player has a cetain weapon equiped.
In fact every weapon could have a flag and a single script could handle them all.

So, every weapon's pickup would need to set that weapons flag to a value other than zero.

Each of the weapon keys (0-9) would have to be monitored, so that equiping different weapons would be detected.
So, when you press 4 for the fourth weapon, then the script would flag that weapons variable as on, and then reset the other weapon variables to zero.

Then the characters' scripts could each be made to max the entities health unless that weapon's flag is detected.
If the flag was raised (value greater than zero) then the script would not max the entites health so he would then take damage.

Using the flags would be cool because then you could also have audio replies or taunts when the wrong weapon is equipped.

"Mwuhahahahaha, your inferior weapons will not work on me human!"

or if the flag was raised and he got shot...

"What? Where did you get that [super weapon name here]? Ahhhh!"

You would only want the reply to play once, so you could flag that too. (a local variable would work for this one, or even an activation )

Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 31st Jan 2009 19:39
Wouldn't you have to force the player to get their weapons in a specific order then? How else would you determine which weapon is in which slot?


The one and only,


Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 31st Jan 2009 21:06 Edited at: 31st Jan 2009 21:24
Quote: "Wouldn't you have to force the player to get their weapons in a specific order then? How else would you determine which weapon is in which slot? "

Well, that isn't that hard to do.
Force on the base set, and then have the super weapon as the only other one they can add, so you know its in the last slot.

And if that works then why would you need another way?

Nevermind then, sorry the suggestion wasn't good enough.
I was just thinking of something for a super weapon to kill a boss character.
So, you have to force on the other weapons, but hey, it is a work around you know, so expect quirks.
I still think it is doable to some extent, and could be a decent effect.

Also, if they have to buy their weapons at a store rather than picking them up from enemies, then you could solve that order issue too.
Because then you could have a counter keeping track of which slot is being equiped.

Or, you could flag the superweapons slot with a value higher than the other weapons.
Then we could tell by the value of the flag whether it was the superweapon.

So, actually there is more than one way to do it without the certain order.

Login to post a reply

Server time is: 2024-11-24 18:49:28
Your offset time is: 2024-11-24 18:49:28