Author Topic: ondeath help wanted  (Read 734 times)

Legacy_Wawmong

  • Jr. Member
  • **
  • Posts: 99
  • Karma: +0/-0
ondeath help wanted
« on: December 29, 2014, 08:23:25 am »


               

hello


 


I'm looking for a bit of help with a small mod i've been working on.


 


What i'm trying to do is create a custom ondeath that auto raises players, jumps them to another area, creates a grave stone where they died then allows players to jump back to their grave stone from a convo. I managed to create the auto raise and have players being sent to another area, i only need help with the last two scripts.


 


Any help would be nice, the mod is almost completed...


 


i know the vault would have something like this but the site is down, otherwise i'd look.


 


thanks



               
               

               
            

Legacy_Sheldomar

  • Newbie
  • *
  • Posts: 40
  • Karma: +0/-0
ondeath help wanted
« Reply #1 on: December 29, 2014, 11:49:37 am »


               

You could SetLocalLocation() on the player, and for the tombstone just CreateObject() at that location. The conversation could then jump the player to that location if they choose.



               
               

               
            

Legacy_Proleric

  • Hero Member
  • *****
  • Posts: 1750
  • Karma: +0/-0
ondeath help wanted
« Reply #2 on: December 29, 2014, 02:25:36 pm »


               

+1


 


The new vault is still available, incidentally.



               
               

               
            

Legacy_Wawmong

  • Jr. Member
  • **
  • Posts: 99
  • Karma: +0/-0
ondeath help wanted
« Reply #3 on: December 29, 2014, 05:36:39 pm »


               

ok, thanks guys.


 


'<img'>



               
               

               
            

Legacy_Wawmong

  • Jr. Member
  • **
  • Posts: 99
  • Karma: +0/-0
ondeath help wanted
« Reply #4 on: December 29, 2014, 06:23:25 pm »


               

alright so i have the gravestone being created at time of death but i'm unsure how to script SetLocalLocation() on the player.


 


i'm really terrible at scripting, sorry.



               
               

               
            

Legacy_Wawmong

  • Jr. Member
  • **
  • Posts: 99
  • Karma: +0/-0
ondeath help wanted
« Reply #5 on: December 29, 2014, 06:42:39 pm »


               

i meant to say i dont know how to jump the player to back to the gravestone...


 


i did figure out SetLocalLocation though...


 


location lLoc = GetLocation(oLooser);

SetLocalLocation(oLooser, "RECALL_LOC1", lLoc);

CreateObject(OBJECT_TYPE_PLACEABLE, "gravestone_1",lLoc);



               
               

               
            

Legacy_Wawmong

  • Jr. Member
  • **
  • Posts: 99
  • Karma: +0/-0
ondeath help wanted
« Reply #6 on: December 29, 2014, 07:02:46 pm »


               

i can jump them to the placeable but how do i make the location they jump to unique for each player?



               
               

               
            

Legacy_Squatting Monk

  • Hero Member
  • *****
  • Posts: 776
  • Karma: +0/-0
ondeath help wanted
« Reply #7 on: December 29, 2014, 08:16:45 pm »


               

If each player is getting their own gravestone, then jumping them to the correct gravestone is the only thing you need. Two options:


 


1: store the created gravestone as a local object on the PC (just like you did with the location), then get and jump to that from the dialog.


2: just jump to the local location that you already stored and created the gravestone at.



               
               

               
            

Legacy_Wawmong

  • Jr. Member
  • **
  • Posts: 99
  • Karma: +0/-0
ondeath help wanted
« Reply #8 on: December 29, 2014, 08:47:43 pm »


               

thanks monk, but that is beyond me. could you write it out for me maybe? thanks



               
               

               
            

Legacy_Wawmong

  • Jr. Member
  • **
  • Posts: 99
  • Karma: +0/-0
ondeath help wanted
« Reply #9 on: December 30, 2014, 12:52:40 am »


               

here is what i made for the unused of a portal, after adding AssignCommand(oPC, ActionJumpToLocation(loc_gs,TRUE)); the script doesnt compile. can anyone tell me what i'm doing wrong please?


 


void main()

 {

object oPC = GetLastUsedBy();

location loc_gs = GetLocalLocation(OBJECT_SELF,"RECALL_LOC1");

//object oLastspeak = GetLastSpeaker();

effect eTeleport1 = EffectVisualEffect(VFX_FNF_MYSTICAL_EXPLOSION);

effect eTeleport2 = EffectVisualEffect(VFX_FNF_SCREEN_SHAKE);



if (GetLocalInt(oPC,"SPAWN_1") == 0)

{

FloatingTextStringOnCreature("You have no gravestone", oPC, FALSE);

return;

}

if (GetLocalInt(oPC,"SPAWN_1") == 1)

{


ApplyEffectToObject(DURATION_TYPE_INSTANT, eTeleport1, oPC);

ApplyEffectToObject(DURATION_TYPE_INSTANT, eTeleport2, oPC);


//DelayCommand(1.5, AssignCommand(oPC, JumpToObject(GetObjectByTag("Gravestone_1"))));

AssignCommand(oPC, ActionJumpToLocation(loc_gs,TRUE));

SetLocalInt(oPC, "SPAWN_1", 0);

return;

}

}



               
               

               
            

Legacy_Squatting Monk

  • Hero Member
  • *****
  • Posts: 776
  • Karma: +0/-0
ondeath help wanted
« Reply #10 on: December 30, 2014, 01:56:19 am »


               Just remove the TRUE parameter from ActionJumpToLocation().
 
Also, you'll want to change the first parameter on this line...
location loc_gs = GetLocalLocation(OBJECT_SELF,"RECALL_LOC1");
... to this:
location loc_gs = GetLocalLocation(oPC,"RECALL_LOC1");
Because the location is stored on the PC (I'd assume, anyway. otherwise everyone is jumping to the same location).
               
               

               
            

Legacy_Wawmong

  • Jr. Member
  • **
  • Posts: 99
  • Karma: +0/-0
ondeath help wanted
« Reply #11 on: December 30, 2014, 02:06:22 am »


               

sweet! everything works now!


 


thanks a lot monk.



               
               

               
            

Legacy_Wawmong

  • Jr. Member
  • **
  • Posts: 99
  • Karma: +0/-0
ondeath help wanted
« Reply #12 on: December 30, 2014, 03:09:09 am »


               

sorry, one last question. im using DestroyObject in my module ondeath event, to destroy the gravestone on a delay. its not working, and im wondering which script handle on the placeable besides heartbeat i could place this so it gets deleted?



               
               

               
            

Legacy_Wawmong

  • Jr. Member
  • **
  • Posts: 99
  • Karma: +0/-0
ondeath help wanted
« Reply #13 on: December 30, 2014, 03:29:33 am »


               

this is what im using in my ondeath for this issue. doesn't work though...


 


object gravestone1 = GetObjectByTag ("Gravestone_1");

DelayCommand(70.0, DestroyObject(gravestone1));



               
               

               
            

Legacy_Wawmong

  • Jr. Member
  • **
  • Posts: 99
  • Karma: +0/-0
ondeath help wanted
« Reply #14 on: December 30, 2014, 04:23:04 am »


               

nevermind, got it working. placed the script on my portal convo instead.


 


thanks for the help everyone.