FAQFAQ    Board RulesBoard Rules    SearchSearch    LotteryLottery    RouletteRoulette    UsergroupsUsergroups
     RegisterRegister  ProfileProfile    Log in to check your private messagesLog in to check your private messages    Shop    Log inLog in 
View posts since last visit View your posts View unanswered posts

Elevator example

 
Post new topic   Reply to topic    Mafiascene.com Forum Index -> Modding Tutorials
View previous topic :: View next topic  
Author Message
djbozkosz

Mafiascene Veteran Modder
Mafiascene Veteran Modder


Joined: 06 Mar 2013
Posts: 92
Location: Czech Republic
1861 Bank Notes
Items

PostPosted: Tue Aug 11, 2015 11:39 pm    Post subject: Elevator example Reply with quote

Simple map with basic working elevator (no sounds included).

Link:
https://dl.dropbox.com/s/2ca0l338rtapp96/Elevator.zip

Collisions problem:
Mafia has no support for custom moving collisions. Although, there are some possibilites eg. to use "Truck" definition from "mise09-krajina". In this case player is directly linked to the parent object - car (similar to tram / metro) and there isn't "sliding effect". But manipulating is slightly bad.
Also there are f*ckingbox script commands for creating dynamic collisions. But only for creating and not moving!
Fortunately in mission: "mise18-pristav" - second LH port mission is used car with "dynamic" collisions. These colls are used for truck body to player be able enter the truck. Car with this colls can be moved with mo worries.

Therefore, this technique is used for our elevator.

Collisions:
Every 4ds model of car in the game can have "SPECCOLLSxx" dummies for its "special collisions". These colls must be enables by:

car_setspeccoll xx, 1
...(xx is actor's id)

and disabled by:

car_setspeccoll xx, 0

If special colls are enabled car physics and speed are diabled (and vice versa). After enabling you can move with "car" (elevator) via actor_setplacement and spec colls are automatically updated. White moving, spec colls disabling is not needed (also due to physics activation).

Spec colls can be disabled eg. when elevator is critically damaged. Then physics is activated and elevator falls to the floor.

Also (important), before elevator moves, player must stand on the elevator's SPECCOLL and not on the another collision from tree.klz. Only in this case initial player position is automatically updated Wink
_________________

Web | Youtube | Developer at
Back to top
View user's profile Send private message Visit poster's website
GOLOD55

New Member
New Member


Joined: 26 Apr 2016
Posts: 5

13 Bank Notes
Items

PostPosted: Fri May 27, 2016 9:11 am    Post subject: Elevator example Reply with quote

speccolls? interesting. i didn't check its moving via actor_setplacement.
--
tram_actor is suitable for the moving_lift fine also.
--
the only klz moved clipp is bridge. it may be used too. but its a bit hard "to register" 3rd bridge in missions(for city-missions).
Back to top
View user's profile Send private message
AsaSK

Mafiascene Veteran Modder
Mafiascene Veteran Modder


Joined: 24 Feb 2013
Posts: 575
Location: London, England
8240 Bank Notes
Items

PostPosted: Sat May 28, 2016 11:06 pm    Post subject: Elevator example Reply with quote

Boz this is brilliant! I love that modders are still finding workarounds for things not originally implemented in the LS3D engine Very happy

I remember something similar in the Casino Mod by Braingib, but that elevator was 'juddery', this is very smooth! Would I be allowed to implement this in my mod further down the line and credit you?
_________________

The official Mafioso Mod thread
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Mafiascene.com Forum Index -> Modding Tutorials All times are GMT
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

Generation Time: 0.017 | Queries: 19