

Danukem, on 19 August 2021 - 12:44 PM, said:
state navigate // navigate to the waypoint. for TEMP sprofstat 1 { getactor[TEMP].hitag MHITAG ldist xydist THISACTOR TEMP } ifvarvare MHITAG COUNT // make sure the waypoint he is going to is the next sequential one, so he doesnt backtrack. // IE only find nearactor with a hightag the count currently has, one at a time. { getactor[TEMP].x MX getactor[TEMP].y MY getactor[THISACTOR].x x getactor[THISACTOR].y y subvarvar MX x subvarvar MY y getangle ANGVAR MX MY setactor[THISACTOR].ang ANGVAR ifl xydist 512 ifvarvare MHITAG COUNT // add 1 to count only if the current waypoint has the same value as the one where the player was moving towards, // used to prevent a retrigger causing the count to rise 1 every tick the actor is within the set distance { addvar COUNT 1 spawn EXPLOSION2 break // force restart of the subroutine } } ends
This post has been edited by jimbob: 21 August 2021 - 08:09 AM
onevent EVENT_LOADACTOR // switch sprite[].picnum // other way of checking the picnum, seems needlessly complicated. // case WAYPOINT ifactor WAYPOINT { getactor[].hitag MHITAG getactor[].lotag MLOTAG // setactor[].hitag ZERO // resetting to zero seems counter intuitive to what i need. // setactor[].lotag ZERO } // break // endswitch endevent state navigate for TEMP sprofstat 1 ife sprite[TEMP].picnum 5427 { setactor[THISACTOR].pal 2 // if found the node, turn angry and try to grab it. getav[TEMP].HITAG MHITAG ldist xydist THISACTOR TEMP } ifvarvare MHITAG COUNT // make sure the waypoint he is going to is the next sequential one, so he doesnt backtrack. //IE only find nearactor with a hightag the count currently has, one at a time. // ife sprite[TEMP].hitag COUNT { getactor[TEMP].x MX getactor[TEMP].y MY getactor[THISACTOR].x x getactor[THISACTOR].y y subvarvar MX x subvarvar MY y getangle ANGVAR MX MY setactor[THISACTOR].ang ANGVAR { getav[TEMP].HITAG MHITAG ldist xydist THISACTOR TEMP } } else break ifl xydist 512 ife sprite[TEMP].hitag COUNT // ifvarvare MHITAG COUNT // add 1 to count only if the current waypoint has the same value as the one where the player was moving towards, // used to prevent a retrigger causing the count to rise 1 every tick the actor is within the set distance { setactor[THISACTOR].pal 1 // visual check, does he reach the point and stay in this line of code? // it apears not. he immediatly turns to spritepal 2 again after briefly flashing blue. /// IE once the nasty node has been grabbed and destroyed move to the next one. addvar COUNT 1 spawn EXPLOSION2 break // force restart of the subroutine } break ends
This post has been edited by jimbob: 22 August 2021 - 03:22 PM
Danukem, on 22 August 2021 - 04:34 PM, said:
state navigate for temp sprofstat 1 ife sprite[temp].picnum WAYPOINT { getav[THISACTOR].COUNT COUNT getactor[temp].htowner NODE getactor[temp].hitag FOUNDHITAG ifvarvare FOUNDHITAG COUNT { addlogvar COUNT addlogvar FOUNDHITAG addlogvar NODE } ifvarvare FOUNDHITAG COUNT { { getactor[NODE].x MX getactor[NODE].y MY getactor[THISACTOR].x x getactor[THISACTOR].y y subvarvar MX x subvarvar MY y getangle ANGVAR MX MY setactor[THISACTOR].ang ANGVAR { getactor[temp].htowner NODE getav[NODE].FOUNDHITAG FOUNDHITAG ldist xydist THISACTOR temp } ifl xydist 512 { addvar COUNT 1 } } } } ends
This post has been edited by jimbob: 09 September 2021 - 11:02 AM
onevent EVENT_DISPLAYROOMS ifvare currentweapon 3 //ifvare player[THISACTOR].curr_weapon 3 // if player has weapon m4 selected getinput[THISACTOR].bits TEMP1 ifvarand TEMP1 268435456 { addvar turnaround_keytime 1 } else { setvar turnaround_keytime 0 } ifvare turnaround_keytime 1 { xorvar sight_on 1 } ifvare sight_on 1 { setaspect 32768 52428 // activate the 4x scope } endevent
onevent EVENT_DISPLAYROOMS ifvare currentweapon 3 { getinput[THISACTOR].bits TEMP1 ifvarand TEMP1 268435456 addvar turnaround_keytime 1 else setvar turnaround_keytime 0 ifvare turnaround_keytime 1 xorvar sight_on 1 } else setvar sight_on 0 ifvare sight_on 1 setaspect 32768 52428 // activate the 4x scope endevent
onevent EVENT_DISPLAYROOMS { getinput[THISACTOR].bits TEMP1 ifvarand TEMP1 268435456 addvar turnaround_keytime 1 else setvar turnaround_keytime 0 ifvare turnaround_keytime 1 xorvar sight_on 1 } else setvar sight_on 0 ifvare sight_on 1 ifvare currentweapon 3 { setaspect 32768 52428 // activate the 4x scope } ifvare sight_on 1 ifvare currentweapon 6 { setaspect 32768 52428 // activate the 4x scope } endevent
This post has been edited by Salvation: 24 September 2021 - 03:04 PM
ifvare sight_on 1 ifvare currentweapon 6 setaspect 32768 52428
ifvare sight_on 1 { ifvare currentweapon 3 setaspect 32768 52428 // activate the 4x scope ifvare currentweapon 6 setaspect 32768 52428 // activate the 4x scope }
appendevent EVENT_TURNAROUND { geti .bits TEMP1 ifand TEMP1 268435456 add turnaround_keytime 1 else set turnaround_keytime 0 ife turnaround_keytime 1 xor sight_on 1 } endevent onevent EVENT_DISPLAYROOMS { ife sight_on 1 { ife currentweapon 3 setaspect 32768 52428 else ife currentweapon 6 setaspect 32768 52428 else set sight_on 0 } } endevent
appendevent EVENT_TURNAROUND { xor sight_on 1 } endevent
RPD Guy, on 01 October 2021 - 07:52 AM, said:
This post has been edited by bullerbullerseven: 01 October 2021 - 09:56 AM
bullerbullerseven, on 01 October 2021 - 09:54 AM, said:
This post has been edited by Reaper_Man: 14 October 2021 - 05:23 PM
jimbob, on 19 October 2021 - 02:36 AM, said:
This post has been edited by bullerbullerseven: 19 October 2021 - 07:20 AM
getactor[THISACTOR].htextra TEMP ifvarg TEMP 0 // if the actor is set to take some damage from a weapon... { getactor[THISACTOR].htowner TEMP // gets the owner of the weapon into TEMP ifvarvare TEMP THISACTOR // if the owner of the weapon IS this actor setactor[THISACTOR].htextra 0 // set the damage to 0 }
ife sprite[].htpicnum SHOTSPARK1 seta .htextra -1
This post has been edited by Reaper_Man: 19 October 2021 - 09:21 AM
ifvare BOSSFIGHT2 1 { getactor[PANZER].extra temp // get the boss'health divvar temp 50 // divide the health so the lifebar isnt rediculously long. { ifvarl temp 10 { break } else // if health lower than 10 stop doing this code setvar xvar 75 // set starting x coordinate whilevarn temp 0 // loop for each hitpoint { rotatesprite xvar 16 49152 0 199 0 2 16 0 0 xdim ydim // draws HEALTHBAR screentext BIGALPHANUM 160 14 32768 0 0 132 0 0 0 0 5 16 1 2 1056768 0 0 xdim ydim addvar xvar 2 // move to the right subvar temp 1 // next hitpoint } } }
This post has been edited by jimbob: 28 October 2021 - 01:55 AM
ifvare BOSSFIGHT2 1 ifn PANZER -1 ifge sprite[PANZER].extra 0 { getactor[PANZER].extra temp // get the boss' health divvar temp 50 // divide the health so the lifebar isnt ridiculously long. ifvarl temp 10 break // if health lower than 10 stop doing this code setvar xvar 75 // set starting x coordinate whilevarn temp 0 // loop for each hitpoint { rotatesprite xvar 16 49152 0 199 0 2 16 0 0 xdim ydim // draws HEALTHBAR screentext BIGALPHANUM 160 14 32768 0 0 132 0 0 0 0 5 16 1 2 1056768 0 0 xdim ydim addvar xvar 2 // move to the right subvar temp 1 // next hitpoint } }
This post has been edited by jimbob: 28 October 2021 - 10:18 AM