View unanswered posts | View active topics It is currently Thu Dec 26, 2024 6:33 pm



Reply to topic  [ 13 posts ] 
 In drastic need of help for AmmoSquall Leash/Kick 
Author Message
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13144
Location: Here
Reply with quote
Post Re: In drastic need of help for AmmoSquall Leash/Kick
I'm willing to help.


Sun May 22, 2011 9:02 pm
Profile
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13144
Location: Here
Reply with quote
Post Re: In drastic need of help for AmmoSquall Leash/Kick
Rays need an actual variable for some of those arguments, not a value, because the function dumps Data into those vars.

(Any thing in the documentation that says "A reference to," needs an actual variable).
Code:
randomVariableNameA = Vector(0,0);
randomVariableNameB = Vector(0,0);
local rayThing = SceneMan:CastObstacleRay(self.Pos, Vector(5,0,), randomVariableNameA, randomVariableNameB, self.RootID, 0, 2);

And uh,
Quote:
Every single fricking time I ask for help these days I figure it out before I get an answer. The problem is that self.DIS changes every frame, because self.Pos changes every frame.

I got around this by making a particle that didn't move, and set that's Pos to self.Pos, then made a variable to find that particle's position. Since the particle didn't move, it would stay the same, unlike self.Pos.

What is that code supposed to do?


Tue May 24, 2011 12:23 am
Profile
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13144
Location: Here
Reply with quote
Post Re: In drastic need of help for AmmoSquall Leash/Kick
Nonsequitorian wrote:
I don't understand what you mean when you said that rays need variables for some of the arguments.

Some functions dump data into variables. You gotta supply them with the variables first.


Also, it'd probably be easier with trying to explain what effect you're trying to achieve over-all, than to just show code.


Tue May 24, 2011 12:32 am
Profile
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13144
Location: Here
Reply with quote
Post Re: In drastic need of help for AmmoSquall Leash/Kick
Why can't you put this all in one script? And the MORay is for detecting which actor to Leash/Kick in the first place, right?


Tue May 24, 2011 1:08 am
Profile
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13144
Location: Here
Reply with quote
Post Re: In drastic need of help for AmmoSquall Leash/Kick
One step at a time.
CaveCricket48 wrote:
Rays need an actual variable for some of those arguments, not a value, because the function dumps Data into those vars.

(Any thing in the documentation that says "A reference to," needs an actual variable).
Code:
randomVariableNameA = Vector(0,0);
randomVariableNameB = Vector(0,0);
local rayThing = SceneMan:CastObstacleRay(self.Pos, Vector(5,0,), randomVariableNameA, randomVariableNameB, self.RootID, 0, 2);


You supply a ray with a variable, the way I did in the example above. Simply define a variable BEFORE the ray, then put that ray as one of the required arguments (Note - "randomVariableNameA" and "randomVariableNameB").


Tue May 24, 2011 1:44 am
Profile
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13144
Location: Here
Reply with quote
Post Re: In drastic need of help for AmmoSquall Leash/Kick
The function needs them to run. What the function does with them (specifically ObstacleRay() ):
Quote:
Arguments:
-The starting position.
-The vector to trace along.
-A reference to the vector screen will be filled out with the absolute location of the first obstacle, or the end of the ray if none was hit.
-A reference to the vector screen will be filled out with the absolute location of the last free position before hitting an obstacle, or the end of the ray if none was hit. This is only altered if thre are any free pixels encountered.

The third and fourth arguments. It pretty much dumps that information into the variables that you give it, and needs those variables put in or else the function won't work.


Tue May 24, 2011 1:52 am
Profile
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13144
Location: Here
Reply with quote
Post Re: In drastic need of help for AmmoSquall Leash/Kick
It's because targetB is local. It won't work in between functions.


Tue May 24, 2011 8:42 pm
Profile
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13144
Location: Here
Reply with quote
Post Re: In drastic need of help for AmmoSquall Leash/Kick
Yes.


Tue May 24, 2011 9:01 pm
Profile
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13144
Location: Here
Reply with quote
Post Re: In drastic need of help for AmmoSquall Leash/Kick
I usually get that when I forgot to put in a mathematical operation between stuff. Post your code.


Tue May 24, 2011 10:55 pm
Profile
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13144
Location: Here
Reply with quote
Post Re: In drastic need of help for AmmoSquall Leash/Kick
In the first script, try changing all things that look like
Code:
actor.Vel.Y = actor.Vel.Y - .6;

to
Code:
actor.Vel = Vector(actor.Vel.X,actor.Vel.Y - .6);

Dunno if it'll work, but give it a try.

For the second script, your 'for' loop looks funny.


Wed May 25, 2011 12:50 am
Profile
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13144
Location: Here
Reply with quote
Post Re: In drastic need of help for AmmoSquall Leash/Kick
Have a check to make sure 'self.other' actually exists before doing stuff with it.


Wed May 25, 2011 1:30 am
Profile
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13144
Location: Here
Reply with quote
Post Re: In drastic need of help for AmmoSquall Leash/Kick
That script chunk itself looks fine, but there's probably something going on with referencing some non-existent variable.

Post entire script. Or you could PM me the mod if you want, it'd be a lot easier to try to fix things.


Wed May 25, 2011 2:45 am
Profile
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13144
Location: Here
Reply with quote
Post Re: In drastic need of help for AmmoSquall Leash/Kick
I feel the desire to write you up a new script. Is that okay?


Thu May 26, 2011 10:51 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 13 posts ] 

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.267s | 13 Queries | GZIP : Off ]