📧 Message Board Archive

scripting help
At the risk of revealing too much, When I make dink Invisable , I need him to become visable when he attacks or talks to people. Has this been done before? Can I use key scripts to restore his visable sprites and change a variable?( and what key #s are ctrl, space, and shift?)Is there an easier way?  
Re: scripting help
: At the risk of revealing too much, When I make dink Invisable , I need him to become visable when he attacks or talks to people. Has this been done before? Can I use key scripts to restore his visable sprites and change a variable?( and what key #s are ctrl, space, and shift?)Is there an easier way?



Yes, you could use key scripts to change variables.

The key #s for ctrl, space, and shift aren't available for editing, they're scripted internally.

What are you using to make Dink invisable? sp_nodraw ?



Consider this...  

Create a white, 1x1 .bmp and set it up with a weapon-type script, replacing Dink's walk, idle, and attack with the bmp when the item is equipped. Then in the "use" proc, reload the normal graphics, and set cur_item to equal 1 (his fists).

To make him visable when talking, I think you'll need to do an if/then a global variable in all sprites he could talk to in that part of the game.  If invisibilty is active, the "talk" proc of the sprite would reload the original graphics just like "use" from above.  Then of course, "arm" and "disarm" in the invisible-item/weapon script would also turn the variable on and off respectively.



Oh, wait, you said an easier way... nevermind ;)





Re: scripting help
Hm...this could work. I was thinking of using a shadow sprite to show location while invis. I'll need to put the var. checker in a lot of scripts though. Dink can already teleport anywhere so all sprite with eyes to see will need to react diffrent while he's invisable. Mwahahaha
Re: ...then again
further pondering has revealed at least two downsides to my before-mentioned plan.



1. Using the "use" proc would make dink visable any time he pressed enter, meaning, even if the player was simply punching the air, he would become visible.



2. If you had some cool idea like having "Invisible Dink" sneak up behind a guard and chloroforming him, the item-chloroform would not be equipped...



One solution to the first problem would be to put the graphics switch in the npc's "hit" proc instead of item-invisibility's "use" proc, if you're already doing the graphics switch in the npc's "talk" procs anyway, that wouldn't be so bad...



As for the second problem...

Re: ...then again
: further pondering has revealed at least two downsides to my before-mentioned plan.

: 1. Using the "use" proc would make dink visable any time he pressed enter, meaning, even if the player was simply punching the air, he would become visible.

: 2. If you had some cool idea like having "Invisible Dink" sneak up behind a guard and chloroforming him, the item-chloroform would not be equipped...

: One solution to the first problem would be to put the graphics switch in the npc's "hit" proc instead of item-invisibility's "use" proc, if you're already doing the graphics switch in the npc's "talk" procs anyway, that wouldn't be so bad...

: As for the second problem...



I got it working o.k. Dink is briefly visable while attacking, I think thats o.k. then when he hits someone he is fully visable again. Looks good.