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 / Script Conjured Body Armour, Help!

Author
Message
lotgd
14
Years of Service
User Offline
Joined: 2nd Apr 2010
Location: italy
Posted: 9th Apr 2010 06:11 Edited at: 9th Apr 2010 18:51
using this script

http://forum.thegamecreators.com/?m=forum_view&t=143677&b=24

time protection running normally, but when I shoot continuously, stops, and the protection remains to infinity, until I go to a safe area, there time and again rises protection.

How do I make that time continuing to reduce the protection even when I shoot?

Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 11th Apr 2010 06:18 Edited at: 11th Apr 2010 06:24
You do not edit the timer script to adjust the body armor, you would edit the bodyarmor script.

If the timer is giving you problems then make sure the entity running it has its ALWAYS ACTIVE set to YES.

I would try to help you more, but I do not fully understand your problem from your explination. (you lost me)
If you have Fraps, then shoot a short video showing me what you mean.
That way I will better understand what is going on with it.

   Conjured Entertainment

 WARNING: Intense Madness
Les Horribres
19
Years of Service
User Offline
Joined: 20th Nov 2005
Location: My Name is... Merry
Posted: 11th Apr 2010 11:13
Hmm... It looks like someone is, for what ever reason, using 5 variables for the price of one :p

If timer is still global, and resets to timer causes issues... then the only point to that script is to allow make makeshift programing instead of strong procedural programming.

*I'll get to my point soon enough*


I would assume that the only point to using 5 global variables is so that people can check these variables values and reset them independent of other timers. Unfortunately, no script will actually have its own "unique" variable... so only a maximum of 5 scripts can use these timers (instances or independent).

Instead, the program should be rewritten to use a single variable, incriment it 4 times, then reset it. This variable should NEVER be touched, only observed. (though I'd perfer 500ms or 250ms over 1s).

This means 4x more code for everyone, but it also means that people will never have to worry about who is using which global var... only that I, Merry, patent globalvar=0 as mine and mine alone! Which gets to my point.



You obviously are using conjures script because someone told you that hudtimer works for all scripts thus making timer worthless. But what they forgot to tell you is that
A) Timer may be global, but the script is not. You need to have the script follow you in the form of an entity because script processing is based on the distance the player is from a running script.

B) Said script is just as likely to cause problems as hudtimer it self, and if you are using multiple scripts that use the vars, then you are screwed.



Course, I don't even know what the changes have been, so Go right on ahead... I'm just a storm passing through.

Its not who you are or what you've done... its WHY you did it and how far you are willing to go.
If you fear speaking for yourself, make use the words of others while discovering your own voice.
lotgd
14
Years of Service
User Offline
Joined: 2nd Apr 2010
Location: italy
Posted: 11th Apr 2010 15:35
I was in conflict with some other script or entities in empty room no longer creates that problem, if it draws you write, thanks for the reply, very kind
Les Horribres
19
Years of Service
User Offline
Joined: 20th Nov 2005
Location: My Name is... Merry
Posted: 12th Apr 2010 04:52 Edited at: 12th Apr 2010 05:08
Hmm, you seem to have some influence conjured.

Sans bugs, this code, however, should be stronger


Usage:



But thats rather weak coding. If someone were to use globalvar=0 for themselves then we'd run into a few problems... lets fix it





this code forces globalvar=0 to always be the correct value. It say screw you to anyone who attempts to modify it, and will never fail any script that uses said timer, unless there exists another script using timer (which, I assume, was the point of your script).

Heh, we could, in fact, be even more brute about it





If anyone has ANY script that runs lower than 100ms, please inform me. I'll have it run at 1ms if needed.

Its not who you are or what you've done... its WHY you did it and how far you are willing to go.
If you fear speaking for yourself, make use the words of others while discovering your own voice.
lotgd
14
Years of Service
User Offline
Joined: 2nd Apr 2010
Location: italy
Posted: 13th Apr 2010 22:42
Les Horribres thank you very much, very kind

Naples in the heart
Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 14th Apr 2010 01:00 Edited at: 14th Apr 2010 01:51
Quote: "Hmm... It looks like someone is, for what ever reason, using 5 variables for the price of one :p

If timer is still global, and resets to timer causes issues... then the only point to that script is to allow make makeshift programing instead of strong procedural programming."

Hmm, seems like someone doesn't have a clue about what this script is for if they can't unsderstand why its using 5 variables.

The only problem with my script is the usage.
Of course you will have a conflict if you have other scripts modifying the global timer.
Of course you will need to write a different script or modify this one to get results other than those intended by its design.

This timer script was written for a specific function, and it works perfectly as it was intended with proper usage.
This script was intended to create a system to allow for 5 independent timers (even seconds only) using the one global timer that is provided with the stock engine.

If you use other scripts that reset the global timer, then YES, you will have a conflict and I have explained the scripts usage many times in the forums.
The whole point of this script was to use variables as timers independently without having multiple scripts using the global timer. (you could have many more than 5)

You reset each timer outside of this script (setvar=0 in other scripts to reset them) but you never mess with the global timer.
This should be the only script in your game that uses the global timer if you are using this script.
The purpose of it is to allow multiple timers, which it does, by incrementing the 5 variables once each second.
You simply read that variables value to determine how many seconds have past since you reset that paticular timer (that variable).

Quote: "A) Timer may be global, but the script is not. You need to have the script follow you in the form of an entity because script processing is based on the distance the player is from a running script."

That is why the entity using the TImer script has it ALWAYS ACTIVE set to YES, then the distance doesn't matter.

Quote: "But thats rather weak coding.If someone were to use globalvar=0 for themselves then we'd run into a few problems... lets fix it"

There is no fix for having two scripts using the same variable.
That is a conflict no matter how weak or strong the code is, and the only fix for that is to use a different variable for one of the scripts so there is no conflict.

Quote: "then the only point to that script is to allow make makeshift programing instead of strong procedural programming"

Makeshift?
Yes!
This script was a work around for the lack of multiple timers in the stock engine, and it served its purpose well for me.
Sorry I troubled you all without my makeshift code by sharing.

Quote: "this code forces globalvar=0 to always be the correct value. It say screw you to anyone who attempts to modify it, and will never fail any script that uses said timer, unless there exists another script using timer (which, I assume, was the point of your script)."

That is my point, no matter what you do, if you have another script starting the global timer then any change to this is in vain.
There is no fix for the problem he had, other than getting rid of this or the conflicting script.

You are attempting to fix something when you are assuming its purpose.
The fact is, that it works fine for what it was intended to do as it is, IF you use it properly.

Please, do not say that my script should be written another way if you don't know what it is for or you do not know how to use it properly.
Could be coded differently, yes, should be, no.
I am capable of coding in FPI, and when I need help I will ask for it.
If you want to modify my script or write your own that is better, then fine, but don't tell me how I should code.

Quote: "Hmm, you seem to have some influence conjured."

Not much.

   Conjured Entertainment

 WARNING: Intense Madness

Login to post a reply

Server time is: 2024-11-24 23:49:54
Your offset time is: 2024-11-24 23:49:54