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 / A real doozy... Need help with tractor-beam script!

Author
Message
Wraith Staff
17
Years of Service
User Offline
Joined: 3rd Apr 2007
Location: Hamilton, OH
Posted: 15th Oct 2009 01:58
Hey everyone! I'm working on a bit of a crunch and need some quick yet effective help on the Tractor-beam script for Physix... This might sound a bit rude, but I'm at wit's end on this one: I KNOW it's possible, so if your only comment is negative or untested, please don't post! I don't mean to sound like a jerk, but I've been working nonstop on this one and GP Labs needs the game finished by late December! I've had many different variations on how I've tried it, but none work... Here's what I need:

I have an entity that is just a glowing blue pipe (the "beam") with collision turned off. A crate and/or barrel (depending on level) that can have its gravity changed (got that to work with Ply's help) and when it comes in contact with the beam it follows it. At any given time, the player can turn off the beam and the crate will stop following it. Most of the time the beam is in midair, but I have a fix for that using PhysMod (again, Ply's work).

Here's how I planned/failed to do it. The beam entity would be a "zone" on top of a waypoint. When the crate touches the zone it would activate a part of its script similar to "follownorotate". Thus making it follow the waypoint. When the beam is destroyed or the crate leaves the zone, it reverts back to its standard AI.

It seems to work theoretically, but one of the major problems I faced was that it seems I must have physics OFF to use anything similar to "follownorotate". The player in my game would need to throw the crate at the beam as part of the puzzles and without physics activated the player can't even grab the crate.

The good thing about PhysMod is that I can turn gravity back on whenever it's off, which is a major part of the gameplay.

I've used many different scripts to try and achieve this effect (usually one on the beam and the other on the crate) but most are just rubbish that I end up pitching afterward.

Frankly, I've got nothing... Well except a looming deadline and a big headache, that is

I can give more info if needed, feel free to ask. I might be able to recreate my failures to show everyone, but that's numbering in the hundreds

Anyone got anything?


Physix Coming Soon...
Hockeykid
DBPro Tool Maker
17
Years of Service
User Offline
Joined: 26th Sep 2007
Location:
Posted: 15th Oct 2009 02:47
Well I can tell you right here and now that fpsc turns off physics of for the current object when it needs an object to "define physics." Physics never get turned back on for the object.

Wraith Staff
17
Years of Service
User Offline
Joined: 3rd Apr 2007
Location: Hamilton, OH
Posted: 15th Oct 2009 03:03
Quote: "Well I can tell you right here and now that fpsc turns off physics of for the current object when it needs an object to "define physics." Physics never get turned back on for the object."


Yeah, I knew that already. One of the questions that needs to be answered is: "Can an object (as opposed to a character) follow a waypoint in vanilla FPSC without having its physics turned off?"

That's one of the biggest hurtles. Another option is some sort of workaround to the waypoint part... maybe using an invisible platform entity, or something. Unfortunately the final option is to ask/pay Ply (when I have money) to work it out in Physmod, thought I wouldn't be able to ask until at least the end of this month, but seeing how long it's taking to get the new source out, that might not matter. Of course I have no clue how hard it would be to mod (and of course the and deadline)!


Physix Coming Soon...
Hockeykid
DBPro Tool Maker
17
Years of Service
User Offline
Joined: 26th Sep 2007
Location:
Posted: 15th Oct 2009 03:11
Quote: "Yeah, I knew that already. One of the questions that needs to be answered is: "Can an object (as opposed to a character) follow a waypoint in vanilla FPSC without having its physics turned off?"
"



Could you please post the script?

Wraith Staff
17
Years of Service
User Offline
Joined: 3rd Apr 2007
Location: Hamilton, OH
Posted: 15th Oct 2009 03:20 Edited at: 15th Oct 2009 03:21
Sure... Here's one of the ones that seemed the most feasible (as you can tell, it didn't work):

For the entity:




For the beam:



... There where several others I worked with, but I ended up deleting/editing over them. Hope you can find some sort of solution.


Physix Coming Soon...
Hockeykid
DBPro Tool Maker
17
Years of Service
User Offline
Joined: 26th Sep 2007
Location:
Posted: 15th Oct 2009 03:22
And which part of the script is turning off physics?

Wraith Staff
17
Years of Service
User Offline
Joined: 3rd Apr 2007
Location: Hamilton, OH
Posted: 15th Oct 2009 03:32
Quote: "And which part of the script is turning off physics?"


Hmm....? None. The purpose of the script wasn't to turn off the physics at all. The reason I found for even turning the physics off (at it's default, not IN the script) was because I noticed that an antigravity platform had it's physics off by default. When I tried making my cube script originally, I had it set up exactly like a platforms (without adding an activation variable). It proceeded to just float up to my waypoint wherever I placed it. When I set it to need activation, I couldn't even move it (it just hovered in place without moving). When I set it to default physics "on", it wouldn't follow my waypoint at all, no matter where it was. Does this help?


Physix Coming Soon...
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 15th Oct 2009 08:03
Well, seeing as my name was mentioned (and it's the only thread left in this board that I haven't looked at) I might as well put my two cents in.


There a couple of ways that I would go about this. One doesn't involve modding the source, but it's.... not very dynamic. Here is it, in pseudo-code:

1) Give your "zone" that beam script you just posted. That will activate any objects like you said, telling them that they are inside the beam and need to act accordingly.

2) Set up a dynamic entity at the end of your beam... this will probably be the device that is creating the beam. Name it something meaningful.

3) Have your objects to be sucked up by the tractor beam set that entity as their target via "settargetname" (I haven't worked out how to get them to target it otherwise) and have them "movetotarget".


That's the jist of it. I'm currently in the process of setting it up and trying it out myself (because you asked not to have any suggestions that haven't been tested) and I'll let you know how it goes.


The other idea, requires just a LITTLE bit of modding. Basically, you'll make commands that act like the "PlrMoveNorth/South/East/West" command, except for entities. You then will have 4 different "beam" scripts, which will activate the entities within the zone with 1 of 4 different values. Each value given to the entity will tell it to move north(1)/south(2)/east(3)/west(4)

Those commands shouldn't be terribly hard to make, and it would make your system much more dynamic.


I'll post here and let you know how my tests have gone when I have something of use to give.


The one and only,


Wraith Staff
17
Years of Service
User Offline
Joined: 3rd Apr 2007
Location: Hamilton, OH
Posted: 15th Oct 2009 08:34
@Plystire

Cool, I'm looking forward to what you come up with


Physix Coming Soon...
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 15th Oct 2009 08:57 Edited at: 15th Oct 2009 09:04
Okay, I've done a lot of testing with the "No modding" idea.

Here's the low-down:
I wasn't able to get any desireable results.

Here's a list of the problems:
1) "EntityWithinZone" is one of the commands in FPSC that Lee never finished making... in fact, he never even started. The only thing in that command is a couple comments for his "TODO List"

2) [EDIT] Never mind this one.. Memo to self: Don't change to a state that doesn't exist unless script must remain inactive from that point forth.

3) "MoveToTarget", or any move command for that matter, fails to move the entity if the entity is driven by the physics system. If you turn the "Physics ON?" option in the entity's properties to "NO", it WILL move toward it's target. The problem here then becomes... it will not move if bumped into. Removing the entity from the physics system like that will make it immune to pretty much any physics influences. The most movement I could get out of the object in that state was a slight twist when running into it.
REASONING: Physics driven entities require information from the physics system in order to move... that being, said if the physics system tells it that it shouldn't be moving, then it won't move, even if the object has been directed to move through manual means (AKA the "movetotarget" command). However, removing the entity from the physics system will allow you to move it manually, at the cost of.... well, removing it from physical influences.


I understand your need for BOTH a physical influence upon the object as WELL as a "manual override" option to give a wonderful and appealing illusion.


I hate to be the bearer of bad news, but that's all my tests have netted me.


If, on the other hand, you're comfortable with only having a manually moved object, then here's the scripts I have managed to create:

Triggerzone (Beam) script:


Entity Script:


Setup:
1) Change the entity's "Physics On?" property to "No" for the entity to follow the tractor beam.
2) Place a dynamic entity at the END of the beam and name it "Beam". This is the entity that your boxes or whatever will be moving toward.


There is always an option to Mod the source to attempt a hybrid of physically influenced objects as well as having manual control over them. I didn't look into it too much, so I can't say if it would be difficult or not.


The one and only,


Wraith Staff
17
Years of Service
User Offline
Joined: 3rd Apr 2007
Location: Hamilton, OH
Posted: 15th Oct 2009 09:27
Quote: "There is always an option to Mod the source to attempt a hybrid of physically influenced objects as well as having manual control over them. I didn't look into it too much, so I can't say if it would be difficult or not."


Well, you're the one making my mod I just want to know what you'd charge me this time, on top of the gravity scripts, that is. If you wouldn't mind dropping me a line with a quote...

Hope to hear from you soon


Physix Coming Soon...
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 15th Oct 2009 12:20
Consider the line dropped.

Turns out it was a very easy thing to accomplish! I'm having fun with it already!!


The one and only,


Login to post a reply

Server time is: 2024-11-25 07:44:12
Your offset time is: 2024-11-25 07:44:12