I am working on an area that I can play with to get some experience with modding. However, I don't want to add it to the map... so, the work-around that I was going to use is to have an spell that the player casts, which has a cool cutscene effect (already wrote most of the .baf), then teleports the party to the area I am editing. However, I want to do something like the Pocket Plane does, where it stores the party's x.y coordinates so when I cast the spell again, it teleports the party back to where they were.
I'm not sure exactly how to do this... What I have so far is something like:
IF Global("w#inplayground",0) THEN RESPONSE #100 CutSceneId(Player1) // Code for getting and storing players' X and Y values should go here! CreateVisualEffectObject("SPDIMNDR",Player1) CreateVisualEffectObject("SPDIMNDR",Player2) CreateVisualEffectObject("SPDIMNDR",Player3) CreateVisualEffectObject("SPDIMNDR",Player4) CreateVisualEffectObject("SPDIMNDR",Player5) CreateVisualEffectObject("SPDIMNDR",Player6) Wait(4) FadeToColor([20.0],0) Wait(2) ActionOverride(Player1,LeaveAreaLUA("ARxxxx","",[x.y],z)) ActionOverride(Player2,LeaveAreaLUA("ARxxxx","",[x.y],z)) ActionOverride(Player3,LeaveAreaLUA("ARxxxx","",[x.y],z)) ActionOverride(Player4,LeaveAreaLUA("ARxxxx","",[x.y],z)) ActionOverride(Player5,LeaveAreaLUA("ARxxxx","",[x.y],z)) ActionOverride(Player6,LeaveAreaLUA("ARxxxx","",[x.y],z)) MultiPlayerSync() Wait(1) FadeFromColor([20.0],0) CreateVisualEffectObject("SPDIMNDR",Myself) ActionOverride(Player1,CreateVisualEffectObject("SPDIMNDR",Myself)) ActionOverride(Player2,CreateVisualEffectObject("SPDIMNDR",Myself)) ActionOverride(Player3,CreateVisualEffectObject("SPDIMNDR",Myself)) ActionOverride(Player4,CreateVisualEffectObject("SPDIMNDR",Myself)) ActionOverride(Player5,CreateVisualEffectObject("SPDIMNDR",Myself)) ActionOverride(Player6,CreateVisualEffectObject("SPDIMNDR",Myself)) Wait(3) EndCutSceneMode() ENDAfter which, the spell gets replaced by one that runs:
IF Global("w#inplayground",1) THEN RESPONSE #100 CutSceneId(Player1) CreateVisualEffectObject("SPDIMNDR",Player1) CreateVisualEffectObject("SPDIMNDR",Player2) CreateVisualEffectObject("SPDIMNDR",Player3) CreateVisualEffectObject("SPDIMNDR",Player4) CreateVisualEffectObject("SPDIMNDR",Player5) CreateVisualEffectObject("SPDIMNDR",Player6) Wait(4) FadeToColor([20.0],0) Wait(2) ActionOverride(Player1,LeaveAreaLUA(VAR1a,"",[VAR1b.VAR3c],0)) ActionOverride(Player2,LeaveAreaLUA(VAR1a,"",[VAR2b.VAR3c],0)) ActionOverride(Player3,LeaveAreaLUA(VAR1a,"",[VAR2b.VAR3c],0)) ActionOverride(Player4,LeaveAreaLUA(VAR1a,"",[VAR2b.VAR3c],0)) ActionOverride(Player5,LeaveAreaLUA(VAR1a,"",[VAR2b.VAR3c],0)) ActionOverride(Player6,LeaveAreaLUA(VAR1a,"",[VAR2b.VAR3c],0)) MultiPlayerSync() Wait(1) FadeFromColor([20.0],0) CreateVisualEffectObject("SPDIMNDR",Myself) ActionOverride(Player1,CreateVisualEffectObject("SPDIMNDR",Myself)) ActionOverride(Player2,CreateVisualEffectObject("SPDIMNDR",Myself)) ActionOverride(Player3,CreateVisualEffectObject("SPDIMNDR",Myself)) ActionOverride(Player4,CreateVisualEffectObject("SPDIMNDR",Myself)) ActionOverride(Player5,CreateVisualEffectObject("SPDIMNDR",Myself)) ActionOverride(Player6,CreateVisualEffectObject("SPDIMNDR",Myself)) Wait(3) EndCutSceneMode() ENDSo basically... what I want to know is, can a global be used as a paramater? So can I have something like DoSomething(Global("w#myvar"))?
Also, can I store an area into a variable so I know which one to return to?
Most of the code was taken for learning purposes from Razfallow (razfallow@sigil.cz).
Thanks for your time!
~Michael
Edited by Michael, 11 September 2008 - 06:16 PM.