Jump to content
The Dark Mod Forums

Obsttorte

Active Developer
  • Posts

    6522
  • Joined

  • Last visited

  • Days Won

    111

Everything posted by Obsttorte

  1. Of course I could, but I don't know how and where to upload it this seems possible, at least you could attach the trigger_touch entities at the platform (func_mover) but as everyone may wants his own platform appearence and the triggers have to be sized, I guess this would make more work than necassery (did I spelled this one right?) Here is something I add for illustration: the brown lines show the platform the red lines show the inner trigger made from an cube brush the green lines show the outer trigger made from an cylinder-patch so as you can see the whole setup is quiet easy
  2. vector origin, pos,velocity; float weight,mass,weight_max,move_fac; void lower(entity E) { if (E.getFloatKey("weighted")==1) { E.setKey("weighted","0"); mass=E.getFloatKey("mass"); weight-=mass; pos=origin; if (weight<weight_max) { pos_z-=move_fac*weight; } else { pos_z-=move_fac*weight_max; } $platform.moveToPos(pos); } } void raise(entity E) { if ($player1.heldEntity()!=E) { velocity=E.getLinearVelocity(); //get the velocity of the entity that caused the trigger } else { velocity_z=0; } if (($player1.heldEntity()!=E || $player1.getFloatKey("weighted")==1) && velocity_z==0) // enhanced condition { if (E.getFloatKey("weighted")==0) { E.setKey("weighted","1"); mass=E.getFloatKey("mass"); weight+=mass; pos=origin; if (weight<weight_max) { pos_z-=move_fac*weight; } else { pos_z-=move_fac*weight_max; } $platform.moveToPos(pos); } } else { lower(E); } } void main() { origin=$platform.getOrigin(); move_fac=0.25; weight_max=48/move_fac; } changed method raise(): - added nev vector-variable velocity - see comments for functionality enhanced condition the method checks, wether the entity moves vertically, if it does not it is weighted, else the method lower is called if it was weighted before, the mass will be subtracted and the platform moves up e.g. if the player stands on the platform it goes down, if he jumps it goes up
  3. The platform reacts to everything that has a mass: player, AI, moveables in its current form it will not recognize the player jumping, but this could be added e.g. the platform could check if the player (or any other object) is moving vertically, this must be added to the script This works in the current configuration activation can be done via: void raise(entity E) { //... if (weight>=weight_max) { sys.trigger($nameOfEntity); //triggers the entity } //... } nameOfEntity could be an in-game trigger e.g. that triggers all the effects you want, e.g. opens a hidden door, play a sound or something it could then also trigger the trigger_touch entities to turn them off as they cost a little bit the whole thing consists of three entitys. I'm not sure if they could be packed into one entity, maybe via bind or attach contolling via spawnargs is possible e.g.: -set spawnarg "weight_max" "value" on the platform - in script: float weight_max; void main() { weight_max=$platform.getFloatKey("weight_max"); //reads the spawnarg "weight_max" from entity platform }
  4. because of the strange physics in doom3 the following could happen: if you put something on something on the platform (thats exactly what i mean ) and the platform moves down, the upper entity will hang in the air until it gets an impulse i guess this could be bypassed by raising the platform a little bit before lowering it
  5. the first smiley wasn't intendent it should be an B
  6. Ok i got it you need 3 things one func_mover entity, here named platform one brush abow your platform -> convert to trigger_touch(A) one cylinder-patch around the platform -> convert to trigger_touch( to A add spawnarg "call" "raise" to B add spawnarg "call" "lower" set "start_on" "1" on both of them in the mapname.script file put the following vector origin, pos; float weight,mass,weight_max,move_fac; void lower(entity E) { if (E.getFloatKey("weighted")==1) { E.setKey("weighted","0"); mass=E.getFloatKey("mass"); weight-=mass; pos=origin; if (weight<weight_max) { pos_z-=move_fac*weight; } else { pos_z-=move_fac*weight_max; } $platform.moveToPos(pos); } } void raise(entity E) { if ($player1.heldEntity()!=E || $player1.getFloatKey("weighted")==1) { if (E.getFloatKey("weighted")==0) { E.setKey("weighted","1"); mass=E.getFloatKey("mass"); weight+=mass; pos=origin; if (weight<weight_max) { pos_z-=move_fac*weight; } else { pos_z-=move_fac*weight_max; } $platform.moveToPos(pos); } } else { lower(E); } } void main() { origin=$platform.getOrigin(); move_fac=0.25; weight_max=48/move_fac; } platform is the name of the moving entity weight is the actual weight on the platform weight_max is needed to limit the platform movement move_fac scales the movement the weighted key recognizes if an entity was weighted already everything else should be self-explaining
  7. Thank you This may helps a lot
  8. i did not find a thread in the forum about scripting so i just ask here is there a way to find out whether the player has grabbed an entity at the moment i am working on the last details for a weight dependent pressure plate and i didnt find anything in the wiki thanks in advance
  9. by the way the trigger cann call a script function (at least one) use the arg "call"
  10. i have a question does the trigger_touch entity have a function to find out which or what kind of entity has triggered it
  11. I've tried the following. create an info_tdm_objective_location(A) as for the goto objectives right above your intended pressure-plate. set new objective with mandatory and visible turned of and the following three components: let target entity spawnclass idPlayer be in location A let target AI of team 1 (or any else) be in location A let target entity spawnclass idMoveable be in location A set success logic to "1 OR 2 OR 3" AI and objects that should be able to trigger the objective need spawnarg "objective_ent" "1" Completion target should name your target (in this case your trap) or a trigger_relay entity to triggering multiple things for the pressure-plate i used a mover_door_sliding entity as the objective will also be activated if an object flyes through the info_location you may also combine this with a button-plate as you tried or another smaller info location if you want the trap only to be triggered once set irreversible to true i hope this helps
×
×
  • Create New...