|
Post by commended on Jan 31, 2016 10:47:07 GMT
Hi all, I am making a split screen FPS game and I was wondering how I would go about making different weapons do different damages therefore decreasing Value Print.
Thanks In Advance, Commended.
|
|
|
Post by Power Supersport on Jan 31, 2016 15:00:31 GMT
I need to know how your weapon system is based... Is it based on EventOnContacts or on Scanners... They can both be implemented to deal different damage, but I need to know them... Can you give some examples and also defining their mechanic? The valuePrint decrease can be done with iPrint object... you just print multiple instances of TexPrint object... See script object reference for more info... Script Object Reference: 3drad.boards.net/thread/297/script-object-reference
|
|
|
Post by commended on Jan 31, 2016 16:51:48 GMT
I need to know how your weapon system is based... Is it based on EventOnContacts or on Scanners... They can both be implemented to deal different damage, but I need to know them... Can you give some examples and also defining their mechanic? The valuePrint decrease can be done with iPrint object... you just print multiple instances of TexPrint object... See script object reference for more info... Script Object Reference: 3drad.boards.net/thread/297/script-object-referenceI am using a Event On Contact:)
|
|
|
Post by Power Supersport on Jan 31, 2016 17:02:15 GMT
Well, you can simply have a float that stores your health and:
float health = 100; int time[10];
void Main() { if (IN_22 > 0) { // Weapon 1 Contact time[0] += 1; if (time[0] == 1) { health -= 10; // Damage taken from the Weapon 1 } } else time[0] = 0;
if (IN_44 > 0) { // Weapon 2 Contact time[1] += 1; if (time[1] == 1) { health -= 5; // Damage taken from the Weapon 2 }
} else time[1] = 0;
if (IN_66 > 0) { // Weapon 3 Contact time[2] += 1; if (time[2] == 1) { health -= 15; // Damage taken from the Weapon 3 } } else time[2] = 0; } You get the idea... You can copy and paste this segment to increase the weapon contacts...
|
|
|
Post by commended on Jan 31, 2016 17:28:53 GMT
I tried it out but I'm having a bit of a struggle to get it to work. Could you give some more precise instructions please. Sorry.
|
|
|
Post by Power Supersport on Jan 31, 2016 17:33:29 GMT
I am giving according to what I am receiving...
You have to tell me how many different EOC-s you have...
And you have to tell me, does the script need to be connected to the character?
|
|
|
Post by commended on Jan 31, 2016 18:10:37 GMT
The script is connected to the character and btw I have no idea what an EOC is.
|
|
|
Post by Power Supersport on Jan 31, 2016 18:13:02 GMT
EOC is EventOnContact...
Tell me how many of them you need to detect?
|
|
|
Post by commended on Jan 31, 2016 18:34:33 GMT
Well its splitscreen, so 2 EOC's
|
|
|
Post by Power Supersport on Jan 31, 2016 18:38:04 GMT
Do you have basic script knowledge?
|
|
|
Post by commended on Jan 31, 2016 18:47:12 GMT
I think so yes, but very basic
|
|
|
Post by Power Supersport on Jan 31, 2016 18:59:12 GMT
So... I am gonna make you a simple code, but you have to extend it to work with your project...
float health = 100; int time[10];
void Main() { if (IN_0 > 0) { // Weapon 1 Contact time[0] += 1; if (time[0] == 1) { health -= 10; // Damage taken from the Weapon 1 } } else time[0] = 0;
if (IN_22 > 0) { // Weapon 2 Contact time[1] += 1; if (time[1] == 1) { health -= 5; // Damage taken from the Weapon 2 }
} else time[1] = 0;
if (health <= 0) { // Do something when the character dies... } } Connect the script to the first EOC, then to the second EOC...
Then connect additional objects to it if you need to start/stop them or whatever... Write the events that need to happen into the section where it says: "Do something when the character dies..."
|
|