Jump to content
The Dark Mod Forums

Search the Community

Showing results for tags 'obsttorte'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General Discussion
    • News & Announcements
    • The Dark Mod
    • Fan Missions
    • Off-Topic
  • Feedback and Support
    • TDM Tech Support
    • DarkRadiant Feedback and Development
    • I want to Help
  • Editing and Design
    • TDM Editors Guild
    • Art Assets
    • Music & SFX

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

Found 1 result

  1. So, as everybody seems to have his own mapping thread, I thought about starting my own. I'm currently working on my map for the "unusual gameplay contest" and just set up a nice working elevator. I took a look one the multi-level elevator tutorial on the wiki and I think that my approach is much more easy to implement, so I thought I could describe it here. The elevator consists out of three parts: - a func_mover entity that will be our elevator-platform - the buttons that will control the elevator - a couple of waypoints, one for each floor what else do we need: a really short script, I'll go to explain further down The first step is to create an elevator-platform. This is your part . If your done with it change its classname to func mover (under entities/func/movers). Rename it to platform. (The names are for referance. Of course you can choose them as you like). The next step is to create some path_corner entities and place them, where you want your platform to stop. Be aware that the origin of the platform entity will move to the center of the bottom face of the pink block representing the path_corner. Let the platform target the path_corners. Make sure you start with "target0", then "target1" and so one. Start with the lowest path_corner and move upwards level by level. Create buttons for every floor on one of the levels. For the other you can just copy them around when we've set them up. On the buttons, you have to set three spawnargs. - target: let the buttons target the platform (so you have to insert its name here) - state_change_callback: set this to "movePlat". This is the name of the function we'll use to move the elevator - moveDir: set this to "0" for the lowest button, "1" for the next one and so one. This spawnarg controls which path_corner the platform should move to When you're done, copy the buttons to where else you'll need them. Ok, that's the setup in Dark Radiant. Now everything that's is needed is a script. And here it is. void movePlat(entity button,boolean bOpen,boolean bLocked,boolean bInterrupted) { entity mover = button.getEntityKey("target"); entity target = mover.getEntityKey("target"+button.getKey("moveDir")); mover.moveTo(target); } The "state_change_callback" is called everytime when the state of the specific object was changed, for example if a button is pressed. The function receives four arguments, of which we will only need the first one. The entity that we get here is the one who has called the script. In this case, the button we have pressed. Now what does the code do. The first line brings us the entity targeted by the button. This is our platform. We need to know this as we want to make it move The second line gives us the path_corner the platform should move to. Here you can see why you should start targeting them from 0 upwards and what the "moveDir" spawnarg is used for. An example: If you push a button whichs "moveDir" spawnarg is "1", than the platform targeted by the button will move to the path_corner targeted by the platform via the spawnarg "target1". The last line is quite self-explaining. It tells the platform to move to the designated path_corner. That's it. Pro's: - short code that is used for every elevator in the map (in fact you can use it for everything that translates) - fast setup Con's: - As I didn't tested it very much I don't know any if you find some please report here What is missing: - there are no sounds set up yet (will add them as soos as possible) - AI's should not yet be able to use the elevator (dido)
×
×
  • Create New...