

insane_metalhead, on 21 September 2011 - 02:13 PM, said:
gamevar hitagsaved 0 2 // var used for grabbing the hitag from the actor right when it's loaded into the map gamevar temphitag 0 2 // temporary var used for storing the hitag as an actorvar gamevar fakehitag 0 2 // var used for the storing the hitag value so it can be read in actor code. gamevar GLOBALHITAG -1 0 // a global var that will be set when the "START" teleport actor is engaged. gamevar x 0 2 gamevar y 0 2 gamevar z 0 2 gamevar sector_actor 0 2 gamevar sector_player 0 2 // just position/sector variables. define TELEPORTSTART 3328 // the actor that the player engages define TELEPORTEND 3329 // the actor that changes the player's coordinates eventloadactor TELEPORTSTART // when the TELEPORTSTART actor is loaded into the map... getactor[THISACTOR].hitag hitagsaved // get its hitag value setactorvar[THISACTOR].temphitag hitagsaved // and set the "temphitag" variable to whatever that value is setactor[THISACTOR].hitag 0 // then set the hitag to zero. enda eventloadactor TELEPORTEND // and do the same thing for the TELEPORTEND actor getactor[THISACTOR].hitag hitagsaved setactorvar[THISACTOR].temphitag hitagsaved setactor[THISACTOR].hitag 0 enda useractor notenemy TELEPORTSTART 0 cstat 32768 // make it invisible getactorvar[THISACTOR].temphitag fakehitag // set the "fakehitag" variable equal to the value of the "temphitag" variable getactor[THISACTOR].sectnum sector_actor getplayer[THISACTOR].cursectnum sector_player // get the sector number of both the player, and the TELEPORTSTART actor... ifvarvare sector_actor sector_player // if they're equal (i.e the player is in the same sector as the TELEPORTSTART actor)... { ifhitspace { // if the player hits space... ifcount 15 { setvarvar GLOBALHITAG fakehitag resetcount // set the "GLOBALHITAG" variable equal to the value of the "fakehitag" variable. } } } enda useractor notenemy TELEPORTEND 0 cstat 32768 getactorvar[THISACTOR].temphitag fakehitag // again, set the "fakehitag" variable getactor[THISACTOR].sectnum sector_actor getactor[THISACTOR].x x getactor[THISACTOR].y y getactor[THISACTOR].z z // grab the "TELEPORTEND" actor's x, y, z coordinates and sector number ifvarvare GLOBALHITAG fakehitag { // if the "GLOBALHITAG" variable is equal the the "TELEPORTEND" actor's "fakehitag" variable... setplayer[THISACTOR].cursectnum sector_actor setplayer[THISACTOR].posx x setplayer[THISACTOR].posy y // set the player's sector, x and y coordinates equal to the "TELEPORTEND" actor's... subvar z 6500 // subtract 6500 from the "TELEPORTEND" actor's z-coordinate. (If this isn't done, the screen will briefly flicker towards the floor upon teleporting) setplayer[THISACTOR].posz z // set the player's z-coordinate equal to the new z-coordinate. setvar GLOBALHITAG -1 } // and reset the "GLOBALHITAG" so it can be done all over again. enda
This post has been edited by EmericaSkater: 22 September 2011 - 01:20 AM
Hendricks266, on 11 October 2011 - 04:30 PM, said:
rasmus thorup, on 14 October 2011 - 03:42 PM, said:
This post has been edited by Zaxtor: 29 October 2011 - 05:58 PM
This post has been edited by Zaxtor: 30 October 2011 - 10:48 AM
James, on 04 November 2011 - 02:13 AM, said:
gamevar timer 0 0 gamevar RANDOMSKYVAR -1 0 // initialize this to -1 so it won't be constantly randomized in EVENT_GAME. Also I was experimenting by changing sky textures, though I was checking the number with a digitalnumberz command... onevent EVENT_GAME ifvarl timer 7500 { addvar timer 1 } else { setvar timer 7500 } // add onto the 'timer' var till it's at 7500 (roughly the first five seconds of gameplay) ifvare timer 7500 { ifvarn RANDOMSKYVAR -1 break else { randvar RANDOMSKYVAR 3 } } // randomize the variable when the 'timer' var's at 7500 ONLY if it's -1.... endevent onevent EVENT_RESETPLAYER setvar timer 0 setvar RANDOMSKYVAR -1 endevent
This post has been edited by rasmus thorup: 04 November 2011 - 07:20 AM
gamevar randomstart 7 0 gamevar DONE 0 0 onevent EVENT_LOADACTOR ifvare DONE NO { readgamevar randomstart addvar randomstart 1 andvar randomstart 65535 setvarvar temp randomstart xorvar temp 43690 whilevarn temp 0 { ifrnd 1 { } subvar temp 1 } savegamevar randomstart setvar DONE YES } endevent
rasmus thorup, on 04 November 2011 - 07:12 AM, said: