Location: JBPLAY \ Meteor 2 \ Editing \ Change Player skin Back to Threads |
ParaSait
![]() Joined: 26 June 2007 Posts: 1478 |
27 August 2007 18:50 (UK time)
OK so I'm making a mod and at a certain point the player touches a sector and he gets another skin(like in Ravagers of Time,where you have to choose your skin in the beginning).So how do I make that?
You need to login to create posts in this thread. |
me_mantis
![]() Joined: 26 September 2003 Posts: 1152 |
30 August 2007 17:20 (UK time)
Glad to see you are interested in advanced scripting =) you'd need to have the player select what skin they will get Store it as either a StaticFlag Or make a new item that will be used to pick what you turn into. Then you'd make a script much like the one in barsor.sc (ravagers of time mod) void Switch() { int x, y, hits; int NewObjectId, OldObjectId; char PlayerType [32]; OldObjectId = SC_GetPlayerObjectId(); //Gets the Players new type if(SC_GetItemCount("Wizard Hands" ![]() { strcpy( PlayerType, "Player_Wizard.ob" ![]() SC_GameMessage("You have W hands!!! " ![]() } else if(SC_GetItemCount("Knight Hands" ![]() { strcpy( PlayerType, "Player_Knight.ob" ![]() SC_GameMessage("You have k hands!!! " ![]() } else if(SC_GetItemCount("Archer Hands" ![]() { strcpy( PlayerType, "Player_Archer.ob" ![]() SC_GameMessage("You have no hands!!! What the Gritch do yo think yo doing?" ![]() } else { strcpy( PlayerType, "Peasant.ob" ![]() SC_GameMessage("You have no hands!!! What the Gritch do yo think yo doing?" ![]() } // get player coordinates SC_GetObjectCoords( SC_GetPlayerObjectId(), &x, &y); // add new Object object at coordinates // note that the AI type and side values will be changed when calling SC_SetPlayerObjectId NewObjectId = SC_AddObject( PlayerType, x, y, 0, AI_ROAMING, 1, "", 0, 0, 0); // bind the player to the new sheep object (the old player is hidden automatically) SC_SetPlayerObjectId( NewObjectId); SC_SetSectorTriggerEnabled(497,1); SC_GiveItem("Healing Abilities",-1); hits = SC_GetObjectHits( SC_GetPlayerObjectId());//gets the players hit points SC_SetObjectHits(OldObjectId, 0);//sets tha hp of the old 1 to 0, killing it, and all clients SC_SetObjectHits(SC_GetPlayerObjectId(), hits);// resets the hits.(maybe) } You need to login to create posts in this thread. |
|
Forums system (C) 1999-2023 by James Bunting.
Terms of Use