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 / [LOCKED] Why doesn't this work?

Author
Message
YSG
14
Years of Service
User Offline
Joined: 31st Jul 2010
Location: In your head
Posted: 31st Jul 2010 23:57
;Artificial Intelligence Script

;Header

desc = not one

;Triggers

:plrdistwithin=80:state=1

:state=1:followplr
:state=1:settargetname=enemy

:reachtarget:state=2
:state=2:useweapon


;End of Script
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 1st Aug 2010 04:38
I'm going to go out on a limb here and say that the script is doing exactly what it was told to do.

What are you expecting it to do?


The one and only,


YSG
14
Years of Service
User Offline
Joined: 31st Jul 2010
Location: In your head
Posted: 1st Aug 2010 06:38
It's supposed to shoot the entity named "enemy" when it reaches it. Everything works but the shooting and looking part.
Badger Gamer
14
Years of Service
User Offline
Joined: 23rd Jun 2010
Location:
Posted: 1st Aug 2010 10:37
YSG,

Plysitre might like you to read tutorial #5 ( which he wrote )
in the Official FPSC Guide.

You can download the PDF off this board. (ocfpsguide.pdf)


Hint: each 'square' is 100, 80 would put it in the same square.


Good luck.

System: Core2 quad 2.66Ghz 8gig DDR2 Nvidia GT 9500 512Mb
3x500Gb raid 1+0 21" wide LCD 1680x1050x32bit
FPSC 9 1.16 (and sometime 1.17)
Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 2nd Aug 2010 03:44 Edited at: 2nd Aug 2010 03:50
Quote: ";Artificial Intelligence Script

;Header

desc = not one

;Triggers

:plrdistwithin=80:state=1

:state=1:followplr
:state=1:settargetname=enemy

:reachtarget:state=2
:state=2:useweapon


;End of Script "


:plrdistwithin=80:state=1

That keeps it in state = 1 all the time because state=1 follows the player so it doesn't get further away.

Nothing ever tells it to move to the target so of course it never reaches it unless the player moves to the target having this follow them all the way.

Even then plrdistwithin would be keeping it in state=1 overriding it from ever executing state=2.

Quote: "It's supposed to shoot the entity named "enemy" when it reaches it. Everything works but the shooting and looking part. "


Try this...


If you want it to follow the player until it sees the target and then move to it and attack it, then it would only take a slight edit.

   Conjured Entertainment

 WARNING: Intense Madness
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 2nd Aug 2010 06:47
But if the entity has reached their target (via the player dragging them over there) then would it not enter state 2 and immediately begin firing, then go back to state 1 on the next loop, set the target, find out it has reached the target, fire immediately again. Repeat.

Or am I missing something?


The one and only,


Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 2nd Aug 2010 08:20
Quote: "But if the entity has reached their target (via the player dragging them over there) then would it not enter state 2 and immediately begin firing, then go back to state 1 on the next loop, set the target, find out it has reached the target, fire immediately again. Repeat.

Or am I missing something? "

You're missing something.

   Conjured Entertainment

 WARNING: Intense Madness
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 2nd Aug 2010 08:33
My point was that if the entity ever did reach their target, it WOULD enter state 2, even if only briefly, and would probably continue to use state 2 so long as the entity has "reached" the target.

And what am I missing here?


The one and only,


YSG
14
Years of Service
User Offline
Joined: 31st Jul 2010
Location: In your head
Posted: 3rd Aug 2010 01:10
I understand now. Everything works.
Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 3rd Aug 2010 03:25 Edited at: 3rd Aug 2010 03:37
Quote: "And what am I missing here?"

mwuhahahahaha
Which came first, the chicken or the egg?
Quote: "I understand now. Everything works. "

I'm glad you got it working.


   Conjured Entertainment

 WARNING: Intense Madness
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 3rd Aug 2010 11:22
If you don't actually know what I'm missing here, just go ahead and admit it, I won't think any less of you.

FYI, I tried it out myself and no... I am not missing anything here, it acted exactly as I thought it would.


Quote: "mwuhahahahaha
Which came first, the chicken or the egg?"


You always did have a strange sense of humor. I'm just ... gonna go now.


The one and only,


Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 3rd Aug 2010 22:35 Edited at: 3rd Aug 2010 23:00
Quote: "If you don't actually know what I'm missing here, just go ahead and admit it, I won't think any less of you. "

Hey, I wasn't the one asking if I was missing something.

Quote: "FYI, I tried it out myself and no... I am not missing anything here, it acted exactly as I thought it would. "

That is what you were missing...using your natural talents to make others happy by giving them the answer they seek.

The question was ...
Quote: "Why doesn't this work?"

And even though you could tell what he wanted to do and why it wasn't working just from looking at the code, because you have that skill, but instead of giving him any kind of direction, you reply...
Quote: "I'm going to go out on a limb here and say that the script is doing exactly what it was told to do...What are you expecting it to do?"

So, by choosing to be a smart alec instead of being helpful you were missing the point of the forum, which is to share knowledge.

Even when I came in and tried to help, all you did was reply...
Quote: "But if the entity has reached their target (via the player dragging them over there) then would it not enter state 2 and immediately begin firing, then go back to state 1 on the next loop, set the target, find out it has reached the target, fire immediately again. Repeat.

Or am I missing something? "

Which only proves that you were aware of what the script was doing, which means you could have helped him further when he did answer your question as to what he expected it to do.

So which was it; did you really not understand, or were you rubbing it in our faces that you could help but wouldn't?

Nevermind, I already know the answer to that...
Quote: "I am not missing anything here, it acted exactly as I thought it would. "



P.S.
I am surprised you didn't give an answer to that question about the chicken or the egg.

Quote: "I'm just ... gonna go now. "

do svidaniya

I was only being a smart alec back to you when I said that you are missing something.
I knew you weren't missing anything; I just wanted you to know how it feels to be on the other end of your comments by reversing it on you.
It must have worked if it was enough to get you to actually take the time to try the script.
I like you Plystire, and I admire your skills and talents, but your attitude lately leaves a lot to be desired.
I am trying to help you too by pointing that out, whether you realize it or not.

Quote: " I won't think any less of you."

I already know that is not possible.

   Conjured Entertainment

 WARNING: Intense Madness
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 4th Aug 2010 05:42
Quote: "Hey, I wasn't the one asking if I was missing something."


Touché! Well played.

Quote: "Which only proves that you were aware of what the script was doing, which means you could have helped him further when he did answer your question as to what he expected it to do."


What he answered with was not descriptive enough for me to determine whether his current script was aimed in the right direction or if it needed a re-haul. This would be one reason why I was asking if I was missing something because by the way he phrased his response to my initial question, the script should have been performing admirably.

I stated what I did because I came in after you did, and since you had already assumed control of the situation I figured you had a better grasp of what he really wanted (turns out you did).

Quote: "It's supposed to shoot the entity named "enemy" when it reaches it. Everything works but the shooting and looking part."


That's what he said. His starting script did that. If the entity had reached the target, it would begin shooting. I couldn't fathom why the shooting part wasn't working, but the looking part wasn't working because the entity was never told to look anywhere. Since you had already answered these questions by the time I arrived to read his response, I didn't feel it necessary to iterate what you've already said.

In your response to him, you also stated:
Quote: "Even then plrdistwithin would be keeping it in state=1 overriding it from ever executing state=2."


So my response to that was that the script would execute state 2 and not entirely be over-ridden by state 1. That was the other reason why I asked if I was missing something. It was an honest question, not trying to be snide or anything.

FYI, I am not always at my FPSC computer and cannot always test scripts right away. I am well aware that even I make mistakes at times and will ask for clarification if I'm not entirely sure about a result. Since you didn't honestly answer my question, I had to wait until I was at my FPSC computer to test it for myself.


I'm just here to help where I can, sometimes I need a bit more info to go off of in order to do that to the best of my ability. While I realize you're assuming my attitude to be negative in nature lately, you shouldn't right away since I have a habit of announcing my negativity before assuming a sarcastic/snide role in the conversation.


The one and only,


Nbt
15
Years of Service
User Offline
Joined: 11th Oct 2009
Location: Behind you!!
Posted: 4th Aug 2010 12:42
You two are total nutters

Don't ever change

Shadowtroid
14
Years of Service
User Offline
Joined: 23rd Dec 2009
Location: nope
Posted: 4th Aug 2010 13:18
Quote: "I knew you weren't missing anything; I just wanted you to know how it feels to be on the other end of your comments by reversing it on you."


Ah Conjured, your problem there is that Ply is actually confused very often!

I personally don't mind Ply's attitude. I am a friend of sarcasm.

Nickydude
Retired Moderator
18
Years of Service
User Offline
Joined: 4th Nov 2006
Location: Look outside...
Posted: 15th Aug 2010 02:04
Unhelpful Titles

Please do not simply write "Noob Question", "I am a newb", "One Noobie Question", "A question", "Please help", "This isn't working" or anything similar as the title of your post. We have a search facility, and meaningless titles do not help others find answers to their questions. It will also help you to get quicker responses if people have an idea of your thread content.



For KeithC

Login to post a reply

Server time is: 2024-11-24 21:41:57
Your offset time is: 2024-11-24 21:41:57