Malxados Posted May 31, 2009 Share Posted May 31, 2009 ugh, too long since I scripted from scratch... Anywho, could someone give me a script setting a global boolean, string, and warping you somewhere else? Thanks, Malxados Link to comment Share on other sites More sharing options...
R2-X2 Posted June 1, 2009 Share Posted June 1, 2009 Setting GLobal: (by glovemaster) void main(){ SetGlobalNumber("MY_NEW_GLOBAL", Stage); } Link to comment Share on other sites More sharing options...
Star Admiral Posted June 1, 2009 Share Posted June 1, 2009 For booleans, just change the number to boolean, like in the following script: void main() { SetGlobalBoolean( string "MY_NEW_GLOBAL", int "STAGE" ); } To warp to another module, where the last two parameters are optional: void main() { StartNewModule( string "MODULE_NAME", string "WAYPOINT_NAME", string "MOVIE_TO_PLAY" ); } To warp to another location within the same module: void main() { ActionJumpToLocation( location "LOCATION_NAME" ); } - Star Admiral Link to comment Share on other sites More sharing options...
glovemaster Posted June 2, 2009 Share Posted June 2, 2009 I recommend using this script for warping to another vector in the same module. (You have X,Y & Z coordinates) void main() { object oJump = GetFirstPC(); // Presumably you want to jump the PC, otherwise replace this with: // object oJump = GetObjectByTag("tag_of_npc"); vector vJump; vJump.x = 0.0; // X Coord vJump.y = 0.0; // Y Coord vJump.z = 0.0; // Z Coord float fFacing = 90.0; // 0 degrees is East, 90 is North and follows counter-clockwise respectively. location lJump = Location(vJump, fFacing); AssignCommand(oJump, ActionJumpToLocation(lJump)); } Alternatively if you want to jump to a Waypoint (.utw template) you can use this. void main() { object oJump = GetFirstPC(); // Presumably you want to jump the PC, otherwise replace this with: // object oJump = GetObjectByTag("tag_of_npc"); object oJumpto = GetWaypointByTag("tag_of_waypoint"); location lJump = GetLocation(oJumpto); AssignCommand(oJump, ActionJumpToLocation(lJump)); } Hope that helps. Link to comment Share on other sites More sharing options...
Star Admiral Posted June 2, 2009 Share Posted June 2, 2009 Yours is more detailed. Should have done the same for mine. Thanks glovemaster. BTW, just for my own knowledge, we are allowed to assign commands to the PC with a script? I thought that the AssignCommand() function only works for NPCs. - Star Admiral Link to comment Share on other sites More sharing options...
glovemaster Posted June 2, 2009 Share Posted June 2, 2009 I'm pretty sure you can, considering the PC is used in some scripted dialogues; other than that, it's always worked for me. Link to comment Share on other sites More sharing options...
stoffe Posted June 2, 2009 Share Posted June 2, 2009 BTW, just for my own knowledge, we are allowed to assign commands to the PC with a script? I thought that the AssignCommand() function only works for NPCs. You can; though unless you do it in a cutscene or otherwise have locked out player controls any actions assigned to the player character could be overridden by the player if they clear or manipulate their action queue (the little box where attacks, feats and power uses to be performed are listed). Link to comment Share on other sites More sharing options...
glovemaster Posted June 2, 2009 Share Posted June 2, 2009 You can; though unless you do it in a cutscene or otherwise have locked out player controls any actions assigned to the player character could be overridden by the player if they clear or manipulate their action queue (the little box where attacks, feats and power uses to be performed are listed). Yes, I found that just moving clears the action queue - I'm unsure if there is any function to temporarily stop control of the PC short of NoClicks() which doesn't stop movement. What I did was to stop the player from moving at the same time, off the top of my head I think it was EffectEntangle() or decreasing the PC's movement speed by 100%. Link to comment Share on other sites More sharing options...
R2-X2 Posted June 2, 2009 Share Posted June 2, 2009 You can stop the player by using " ClearAllActions " " ActionDoCommand(SetCommandable(FALSE,oNPC)); " to make the PC unable to control " oNPC "and " object oNPC=GetFirstPC; " to varify oNPC. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.