Aller au contenu

Photo

Moving walls?


  • Veuillez vous connecter pour répondre
27 réponses à ce sujet

#1
Arianna0

Arianna0
  • Members
  • 20 messages

is there anyway to script  moving walls ?

or to make the  Pushblock npc able to Push PCs around ?

 

I am trying to Make a room with  moving walls that the PCs have to thread between

 

I can make the Pushblock NPC walk a waypoint and while not  ideal  would  work for the look of the moving wall

and making it Unbumpable keeps the PCs from being able to push it around  

but   . . . it just basically  goes through the PCs  

 

I would like to make it so they get  pushed   either to fall into a pit   or  at least take some damage  if they get  hit by the "wall"  

 

My other thought is to make some sort  of   trap  that has placeable walls close in on them slowly,  possibly killing the PCs  unless they can disable the trap

 

not sure if either of these is a doable  concept

 

thoughts



#2
Tchos

Tchos
  • Members
  • 5 030 messages

From the sound of all you've been doing, I'm really looking forward to what comes of all this!

 

Yes, what you want can be done, and it's probably best done using a creature wall much as you've already described, but one can be made to resemble a better wall by applying a model effect of a wall placeable onto an invisible creature.  To make it push the PC back, you can apply an AoE effect to the creature with a script attached to the AoE's On Enter slot that forces the NPC to jump to a walkable location calculated to be a short way ahead of the direction the wall is moving.  As long as the distance is further than the AoE range, it will keep pushing the PC back as the PC re-enters the AoE field when the wall continues to get closer.

 

Alternatively (or in addition), the AoE effect can be scripted to cause damage, or send the PC into a pit.  For instance, if the spot calculated for the PC to be forced to returns an unwalkable location (the PC has been pushed into another wall, perhaps), then the PC can be damaged or sent to a pit.


  • ArtemisJ et kamal_ aiment ceci

#3
Arianna0

Arianna0
  • Members
  • 20 messages

I am building with in a world that I do not have the ability to  Add   models and such to  its all tightly controlled in its haks and such.   So I pretty much have to work with what I got  unfortunately.   I Edited the Pushblock so its  long and  thin   it looks alot like a wall in that fashion.

 

What sort of AoE would you suggest?



#4
Tchos

Tchos
  • Members
  • 5 030 messages

Well, you're able to add scripts and presumably blueprints.  Can you add effects (SEF) files?  That's what you'd be adding, not a model file.  The model would be plain vanilla content.



#5
Arianna0

Arianna0
  • Members
  • 20 messages

I may be able to though I have no idea how to    I will ask our  Tech admin about it



#6
ArtemisJ

ArtemisJ
  • Members
  • 127 messages

You absolutely can do this..

 

Your original idea was spot on by using Creatures as wall objects.. Moving objects via scripting is not a very fluid looking operation.. It usually involves killing / spawning / killing / spawning.. it's gross.

 

Creatures moving around as objects is definitely the way to go.. OR a placeble animation that moves the object along an offset of origin but it sounds like you don't want to do either of these..

 

Applying the SEF of an object mdb to a character and then making them invisible could work as well instead of creating a new entry in your appearance .2da or adding custom content to a hak pack as Tchos said.. the Vfx would have to be added to the campaign folder though.

 

Moveable Objects That Can be "Dropped" in place:

  • Make your stone block Character unbumpable and ignore setOrientation on Conversations
  • Add a conversation / script when the player initiates dialogue to move forward.
  • When the creature object reaches a certain trigger where a "pit" exists.. remove collision of the object and use an animation to have the object "fall into the pit".
  • Or spawn the object into the pit and remove the creature.

 

Spike Wall Closing In

  • Same theory as before with the object as a creature.
  • Detecting when the player and the object collide could be tricky. I can think of two ways.. I would probably do option #2.
    • Have multiple area triggers with OnEnter detecting if a player and the wall are both in the same trigger implying they are very close and now the player is taking damage or dying...
    • Use a GetPosition script executed recursively (heartbeat is too slow) detecting how close the player is to a "Spike Wall" then if they are too close (1 or 2 feet) kill them. 

I think this is a pretty cool idea.. I may implement this at some point just to see it.

 

 

EDIT:

To make it push the PC back, you can apply an AoE effect to the creature with a script attached to the AoE's On Enter slot that forces the NPC to jump to a walkable location calculated to be a short way ahead of the direction the wall is moving.  As long as the distance is further than the AoE range, it will keep pushing the PC back as the PC re-enters the AoE field when the wall continues to get closer.

Alternatively (or in addition), the AoE effect can be scripted to cause damage, or send the PC into a pit.  For instance, if the spot calculated for the PC to be forced to returns an unwalkable location (the PC has been pushed into another wall, perhaps), then the PC can be damaged or sent to a pit.

 

I didn't even know you could create "AOE" OnEnter scripts.. can you provide more details on this Tchos?



#7
kamal_

kamal_
  • Members
  • 5 235 messages

EDIT:

 

I didn't even know you could create "AOE" OnEnter scripts.. can you provide more details on this Tchos?

Wall of Fire/Blade Barrier or the like where creatures have effects applied from entering the field. Bumping the creature is less straightforward than just damage, but doable.



#8
rjshae

rjshae
  • Members
  • 4 477 messages

I wonder how smoothly a create/destroy animation loop would work if the "object" being translated is actually using a model-based visual effect attached to an iPoint? Probably there would still be some flickering unless it is done very rapidly; say 15 times a second.



#9
kamal_

kamal_
  • Members
  • 5 235 messages

I wonder how smoothly a create/destroy animation loop would work if the "object" being translated is actually using a model-based visual effect attached to an iPoint? Probably there would still be some flickering unless it is done very rapidly; say 15 times a second.

In my experience as long as you are destroying and creating the object, it is bad and causes tons of lag. You can't do it nearly quick enough and not have lots of lag with objects. Not something I'd do unless it was in a cutscene or during a dialog.


  • ArtemisJ aime ceci

#10
ArtemisJ

ArtemisJ
  • Members
  • 127 messages

Wall of Fire/Blade Barrier or the like where creatures have effects applied from entering the field. Bumping the creature is less straightforward than just damage, but doable.

 

I didn't realize those used script triggers that fired upon entering X distance.. I assume it was just a heartbeat check to see if you were close enough to take damage then applying the damage..

 

I need to check those when I get home. Heartbeat is very slow for "reactive" events and you can't always depend on a onEnter script firing so I am a little curious how these work.



#11
rjshae

rjshae
  • Members
  • 4 477 messages

In my experience as long as you are destroying and creating the object, it is bad and causes tons of lag. You can't do it nearly quick enough and not have lots of lag with objects. Not something I'd do unless it was in a cutscene or during a dialog.

 

Yes, but presumably there would be some caching for use with a visual effect; you aren't creating and deleting, you're applying an effect then removing it. So, potentially it may work better than with a placeable object. Pure speculation, of course.



#12
ArtemisJ

ArtemisJ
  • Members
  • 127 messages

Yes, but presumably there would be some caching for use with a visual effect; you aren't creating and deleting, you're applying an effect then removing it. So, potentially it may work better than with a placeable object. Pure speculation, of course.

 

If you went to the work of making a visual effect.. why do that as opposed to assigning it to a creature?

 

Honestly I think you are right.. a VFX would cause less performance issues and maybe you could even move it via script without destroying / remaking.. it might just take some.. creativity..?

 

(Add a timer to the fade in / fade out then create them all at the same time and let them automatically disappear?)



#13
rjshae

rjshae
  • Members
  • 4 477 messages

If you went to the work of making a visual effect.. why do that as opposed to assigning it to a creature?

 

Well I suppose if you wanted to move something vertically, or a keep it level across an uneven surface. &c.



#14
kamal_

kamal_
  • Members
  • 5 235 messages

Yes, what you want can be done, and it's probably best done using a creature wall much as you've already described, but one can be made to resemble a better wall by applying a model effect of a wall placeable onto an invisible creature.  To make it push the PC back, you can apply an AoE effect to the creature with a script attached to the AoE's On Enter slot that forces the NPC to jump to a walkable location calculated to be a short way ahead of the direction the wall is moving.  As long as the distance is further than the AoE range, it will keep pushing the PC back as the PC re-enters the AoE field when the wall continues to get closer.

 

Alternatively (or in addition), the AoE effect can be scripted to cause damage, or send the PC into a pit.  For instance, if the spot calculated for the PC to be forced to returns an unwalkable location (the PC has been pushed into another wall, perhaps), then the PC can be damaged or sent to a pit.

What tchos said.



#15
ArtemisJ

ArtemisJ
  • Members
  • 127 messages

Well I suppose if you wanted to move something vertically, or a keep it level across an uneven surface. &c.

 

You can do this with an animation.. ;)



#16
rjshae

rjshae
  • Members
  • 4 477 messages

You can do this with an animation.. ;)

 

Which requires special software... :P


  • ArtemisJ aime ceci

#17
ArtemisJ

ArtemisJ
  • Members
  • 127 messages

Which requires special software... :P

 

Making nwn2 modules requires special software. :wub:



#18
rjshae

rjshae
  • Members
  • 4 477 messages

Making nwn2 modules requires special software. :wub:

 

Hey, how much does the Granny software run you for these days anyway? Will I need to sell my first born to afford it?



#19
kamal_

kamal_
  • Members
  • 5 235 messages

Hey, how much does the Granny software run you for these days anyway? Will I need to sell my first born to afford it?

You could sell someone else's firstborn, but they probably wouldn't approve.



#20
Tchos

Tchos
  • Members
  • 5 030 messages

I didn't even know you could create "AOE" OnEnter scripts.. can you provide more details on this Tchos?

 

A dozen posts after you asked this question, I respond!

 

There's nothing to it -- when you create an AoE effect, you can assign it scripts for On Enter, On Heartbeat, and On Exit.  The AoE behaves exactly like a trigger in terms of those three script events, and I use it as such to spawn "triggers" on the ground for quests, since you can't spawn actual triggers. Unlike triggers, AoEs have the advantage of being able to be attached to a creature, and move around with them.

 

It's right here in the function description:

// Create an Area Of Effect effect in the area of the creature it is applied to.
// If the scripts are not specified, default ones will be used.
// You can also specify a tag for the effect object that will be created when
// the effect is applied.
// Brock H. - OEI 04/21/06 -- Added sEffectTag - this is a tag which will
// be set on the spawned AoE object, so that it can be accessed later.

effect EffectAreaOfEffect(int nAreaEffectId, string sOnEnterScript="", string sHeartbeatScript="", string sOnExitScript="", string sEffectTag="" );

  • ArtemisJ aime ceci

#21
ArtemisJ

ArtemisJ
  • Members
  • 127 messages

 

A dozen posts after you asked this question, I respond!

 

There's nothing to it -- when you create an AoE effect, you can assign it scripts for On Enter, On Heartbeat, and On Exit.  The AoE behaves exactly like a trigger in terms of those three script events, and I use it as such to spawn "triggers" on the ground for quests, since you can't spawn actual triggers. Unlike triggers, AoEs have the advantage of being able to be attached to a creature, and move around with them.

 

It's right here in the function description:

// Create an Area Of Effect effect in the area of the creature it is applied to.
// If the scripts are not specified, default ones will be used.
// You can also specify a tag for the effect object that will be created when
// the effect is applied.
// Brock H. - OEI 04/21/06 -- Added sEffectTag - this is a tag which will
// be set on the spawned AoE object, so that it can be accessed later.

effect EffectAreaOfEffect(int nAreaEffectId, string sOnEnterScript="", string sHeartbeatScript="", string sOnExitScript="", string sEffectTag="" );

 

 

My immediate gut level response was that OnHeartbeat is too slow... but then I remembered you told me a few weeks back that you can set custom heartbeat intervals for specific creatures.

 

Which again I'm not sure how I feel about.. Hmmm.. In this scenario I guess it will work..



#22
Tchos

Tchos
  • Members
  • 5 030 messages

I would use On Enter and On Exit.  There shouldn't be any point at which the PC is in the AoE long enough for a heartbeat to come into play, if we're talking about trap walls.

 

As for custom (faster) heartbeats, when I do use them for other purposes, I set them fast only until they complete the tasks that I wanted them to be fast for, afterward setting them back to normal speed.  In other cases I destroy the object entirely, if it's no longer needed.  In most cases, I don't even create the object with the heartbeat until the player has met certain conditions.  Creatures and objects with slower heartbeats I don't generally reset to normal.



#23
ArtemisJ

ArtemisJ
  • Members
  • 127 messages

I would use On Enter and On Exit.  There shouldn't be any point at which the PC is in the AoE long enough for a heartbeat to come into play, if we're talking about trap walls.

 

As for custom (faster) heartbeats, when I do use them for other purposes, I set them fast only until they complete the tasks that I wanted them to be fast for, afterward setting them back to normal speed.  In other cases I destroy the object entirely, if it's no longer needed.  In most cases, I don't even create the object with the heartbeat until the player has met certain conditions.  Creatures and objects with slower heartbeats I don't generally reset to normal.

 

I guess performance is one issue but I was more worried about tying up the heartbeat of a creature that already handles so many things like AI and waypoint walking with doing things strictly related to X goal.

 

For "Spike Block Creatures" it doesn't matter.. but for more complicated things.. I always err on not using heartbeats and generally find myself doing recursive loops.

 

Will OnEnter events trigger if the PC is inside the aoe when it first spawns? Does that count as the first OnEnter?



#24
Tchos

Tchos
  • Members
  • 5 030 messages

As you say, you shouldn't be using the default heartbeat on a creature whose sole purpose is to move a wall.  I use many, many heartbeats for much more complicated things, myself, but if I don't want or need it to also be doing the default heartbeat things like walkwaypoint functions, I don't include references to that.

 

I have to assume that the On Enter event will trigger if you spawn the AoE on top of the PC, since that's how AoE spells are done, and a fireball certainly has its effects immediately if it lands next to you.


  • ArtemisJ aime ceci

#25
ArtemisJ

ArtemisJ
  • Members
  • 127 messages

As you say, you shouldn't be using the default heartbeat on a creature whose sole purpose is to move a wall.  I use many, many heartbeats for much more complicated things, myself, but if I don't want or need it to also be doing the default heartbeat things like walkwaypoint functions, I don't include references to that.

 

I have to assume that the On Enter event will trigger if you spawn the AoE on top of the PC, since that's how AoE spells are done, and a fireball certainly has its effects immediately if it lands next to you.

 

Does the fireball use the OnEnter or does it maybe do a "First check" type thing to see what's in the area as it lands?

 

I would think OnEnter is for things like Firewall that need to apply the damage immediately as you enter then letting the heartbeat take over for per round damage after..?