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 / Animated bridge collision problem

Author
Message
Carloquiga
6
Years of Service
User Offline
Joined: 16th Mar 2018
Location:
Posted: 8th Mar 2019 11:49
Hi, i posted this problem in product chat but it wasn't the right forum, so i'll repost it here.
I added an animated scifi bridge in a game. It's dynamic and its collision works fine, but when i activate it (it changes position) i have no more collision with it.
I tried to add a dynamic floor entity and spawn it when i activate the bridge, but i have the same problem.

The default script of the bridge is this
Quote: ";Artificial Intelligence Script

;Header

desc = Animated_Bridge

;Triggers

:state=0:hudreset,hudx=50,hudy=90,hudimagefine=gamecore\huds\bridge_animated.png,hudname=bridge_animated,hudhide=1,hudmake=display,state=10
:state=10,plrdistwithin=300:hudshow=bridge_animated,hudfadeout=bridge_animated

:state=10,plrdistwithin=300,plrusingaction=1:activate=2
:state=10,activated=2:state=1,setframe=0,sound=audiobank\user\

:state=1:incframe=0
:state=1,frameatend=0:state=2
:state=2:timerstart,state=3

;End of Script"


but i'm using the classic doorremote.fpi (it works fine) because i want to trigger the activation
Quote: ";Artificial Intelligence Script

;Header

desc = Remote Controlled Door (Open and Close)

;Triggers

:state=0,activated=1:state=1,setframe=0,sound=$0
:state=1:incframe=0
:state=1,frameatend=0:state=2,coloff
:state=2,activated=0:state=3,sound=$1,colon
:state=3:decframe=0
:state=3,frameatstart=0:state=0,setframe=0

;End of Script"


thanks
sbegley001
8
Years of Service
User Offline
Joined: 17th Jun 2016
Location: Southern Oregon, USA
Posted: 8th Mar 2019 18:38
Try this:



I just removed the coloff command from the remote door script. Haven't tested but should work I think
sbegley001
8
Years of Service
User Offline
Joined: 17th Jun 2016
Location: Southern Oregon, USA
Posted: 8th Mar 2019 23:57
Let me know if that works for you
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 9th Mar 2019 12:50
@ Carloquiga I took a look at CosmicProphets animated "Bridge2" your using. It seems to have a problem.
Are you getting only two (2) frames of animation also, the up position and down position for the bridge?
There's no smooth animation. I've contacted the creator to get permission to fix and distribute. Waiting for an answer.

In the mean time, if sbegeley001 suggestion to turn on "collision" gives you problems ( i have a feeling it might )
try using the commands "associateplayer" and "unassociateplayer" They are used when the player needs to ride a lift
or platform. That should work.
My games never have bugs. They just develop random features..
Lots and lots of random features...
Location: You know that space between a dresser and the floor ? Yeah, that's where
Carloquiga
6
Years of Service
User Offline
Joined: 16th Mar 2018
Location:
Posted: 9th Mar 2019 19:15
Quote: "Try this:"


I tried but it dowsn't work (i only tried with stock properties of the bridge, that is dynamic and with physics turned on).

Quote: "Are you getting only two (2) frames of animation also, the up position and down position for the bridge?"


I have the full animation, with also the fences that change position during the animation.

Quote: " i have a feeling it might"


I think you was right

Quote: "try using the commands "associateplayer" and "unassociateplayer""


Where i have to insert this command? But i think it's not what i'm looking for because i want to use the activate bridge like a real floor (i need to jump or run when i'm on it)


Thank you guys, let me know
sbegley001
8
Years of Service
User Offline
Joined: 17th Jun 2016
Location: Southern Oregon, USA
Posted: 10th Mar 2019 10:39 Edited at: 10th Mar 2019 10:41


1 Copy/paste this code into a notepad document and save as bridgeremote.fpi
2 Place in your script bank.
3 Attach this script to the bridge and put the name of the bridge in the switch's ifUsed property field
4 Test Game
5 Profit?????

Let me know how it goes
Carloquiga
6
Years of Service
User Offline
Joined: 16th Mar 2018
Location:
Posted: 10th Mar 2019 11:36
Ok i tested this script.
I have to say that it doesn't work, but it isn't so true because the left fence of the bridge has collision, but the other parts don't have collision.

Ps.: The green circle of the entity (when i put it) is very small compared to the size of the bridge, but i don't know if it's a bad thing or not.
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 10th Mar 2019 14:04
Ok, what I think is the problem here is that the "bridge" itself is stretched out to much. The "colon" works with an upright door,
this is a ( lets just say ) a horizontal door. I attached a pic showing what I believe is the problem. The "main bone" is centered
in the middle of the bridge mesh, and all the weights (friction) is centered there also. ( see the Bridge2_Fragmotion pic )
The collision command does work, but not so good for something like this.

Now MY bridge2 from CosmicProphet's Scifi pack was also scaled 1000%, way to much And the animation was messed up ( mine had only 2 frames? )
I made a scaled down one and fix some of the weights & animation. Starmind has graciously uploaded it back to his website as a temp. fix. Yours might be ok?

I fix the collision problem by using the "associateplayer" player commands. I also added a couple static "floor" grates on each end
as extra support for player ( see Bridge2 pic )

My games never have bugs. They just develop random features..
Lots and lots of random features...
Location: You know that space between a dresser and the floor ? Yeah, that's where

Attachments

Login to view attachments
Carloquiga
6
Years of Service
User Offline
Joined: 16th Mar 2018
Location:
Posted: 10th Mar 2019 21:38
Wow great!
Could you send me that script please?
I didn't understand if i have to use the stock entity or i have to use a modified bridge too.
And could i activate that script with a remote switch (i need to activate it by killing a character).

Thank you very much
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 10th Mar 2019 23:03
@ Carloquiga Try the bridge you have now in your files. If it gives you problems, try the new one uploaded to Starmind3D.
The script below is what I used, your situation maybe different. You will have to adjust the distance settings to meet your needs.
Also you can use any switch to activate this. Follow my suggestions on placing several "grates" at each end to help support player.

Carloquiga, How wide is your bridge your using? Since I re-did the mesh, I made it 3 segments wide. Is your wider or less?


My games never have bugs. They just develop random features..
Lots and lots of random features...
Location: You know that space between a dresser and the floor ? Yeah, that's where
Carloquiga
6
Years of Service
User Offline
Joined: 16th Mar 2018
Location:
Posted: 11th Mar 2019 16:19
OK i tested it.
It works, it's not perfect but it works!
Sometimes i remains blocked in the bridge, i can't jump (it's not a big problem) and the camera move strage while walking on the bridge.
I don't know if this is the only way to fix it, but i'll use it right now.

CosmicProphets doesn't know how to fix it? The bridge doesn't work with stock scripts...
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 11th Mar 2019 20:31
@ Carloquiga
Quote: "The bridge doesn't work with stock scripts..."

Well a lot of things have changed in the years since it was made, it might have worked at one time?

In the mean time I'll make a new bridge with multiple segments and see if it works better
If it does I'll post it here
best
My games never have bugs. They just develop random features..
Lots and lots of random features...
Location: You know that space between a dresser and the floor ? Yeah, that's where
sbegley001
8
Years of Service
User Offline
Joined: 17th Jun 2016
Location: Southern Oregon, USA
Posted: 13th Mar 2019 01:54
@Carloquiga

Think i got a solution. Will post soon
sbegley001
8
Years of Service
User Offline
Joined: 17th Jun 2016
Location: Southern Oregon, USA
Posted: 13th Mar 2019 02:15 Edited at: 13th Mar 2019 05:00
Quote: "In the mean time I'll make a new bridge with multiple segments and see if it works better
If it does I'll post it here "

You're a rockstar ncmako


Quote: "Sometimes i remains blocked in the bridge, i can't jump (it's not a big problem) and the camera move strage while walking on the bridge."

I have come up with a "better" solution/work around that works really well, but has the downside of being a little lame to setup. First, heres a video of it in action: (that end bit there is me crouching not falling through )
AiEaX_vTcn8

Step 1: Download cosmicbridge.fpi, defaultcolon.fpi and invisible_d2.dds from this post. Put cosmicbridge.fpi and defaultcolon.fpi into your scriptbank folder and put invisible_d2.dds in your texturebank\common folder.

Step 2: Place the bridge where you want it. Name it d1 and put d2 in the If Used field. Finally, attach the cosmicbridge.fpi to the Main field.


Step 3: Grab the falsewallE from your entities under scifi\wall furniture. Place one down in your level. Don't worry about where it is placed yet just that it's there.


Step 4:
- Change the wall's name to b2
- Make sure Static Mode is set to No
- Change the Main field script to defaultcolon.fpi
- Change Spawn At Start? field to No
- Change Spawn After Delay? to Yes
- Change Texture field totexturebank\common\invisible_D2.dds
- Make sure Health field is 0


Step 5: Grab the rail1b from your entities under Cosmic Scifi\Steps and rails. Place one down in your level.


Step 6: Repeat Step 4 for the rail entity

Step 7:
- Grab your wall and place 3 horizontal ones where the bridge floor will be
- Grab your rail and place 3 along the walls where the bridge rails will be. Make sure they are UPSIDE-DOWN or the collision will be lower than the bridges rails




Step 8: Place a switch in your level and put b1 in the If Used field

Final Step: Test and Refine

TIP: It may help when getting the placement right to wait to change the texture. Leave it as is until positioning is just right, then change the textures to invisible_D2.dds

Attachments

Login to view attachments
Carloquiga
6
Years of Service
User Offline
Joined: 16th Mar 2018
Location:
Posted: 13th Mar 2019 09:04
Oh yes! I tested it quickly but i think it works fine!
sbegley001
8
Years of Service
User Offline
Joined: 17th Jun 2016
Location: Southern Oregon, USA
Posted: 13th Mar 2019 19:15
Quote: "Oh yes!"


Haha I'm glad it worked out for you Post anytime you need help with something for sure
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 15th Mar 2019 21:18 Edited at: 23rd Mar 2019 13:01
@Carloquiga Awesome, you figured a work around, great ! And it works even better
That's what I love about this engine, so many ways to get around little problems.
Keep it up !

Edit: @ sbegley001 I've tried multiple ways of having proper collision with an animated Dynamic bridge like entity,
but I think you have found the best/easiest method so far. I would stick with this method
My games never have bugs. They just develop random features..
Lots and lots of random features...
Location: You know that space between a dresser and the floor ? Yeah, that's where

Login to post a reply

Server time is: 2024-11-21 12:51:29
Your offset time is: 2024-11-21 12:51:29