
EDuke32 Scripting "CON coding help"
#1315 Posted 17 June 2013 - 01:01 AM
#1316 Posted 17 June 2013 - 01:53 PM

#1318 Posted 17 June 2013 - 05:53 PM
#1319 Posted 18 June 2013 - 01:07 AM
view portal ? miror code for floor ???
have some code or mapster keys for this ??


#1320 Posted 18 June 2013 - 08:27 AM
#1321 Posted 18 June 2013 - 01:57 PM
Hendricks266, on 17 June 2013 - 05:53 PM, said:
how set up a view portal in mapster?
#1322 Posted 18 June 2013 - 02:32 PM
Hendricks266, on 18 June 2013 - 08:27 AM, said:
#1323 Posted 20 June 2013 - 02:23 AM
#1325 Posted 21 June 2013 - 04:32 AM
#1326 Posted 21 June 2013 - 06:19 AM
James, on 21 June 2013 - 04:32 AM, said:
It depends on whether you only want to set up a different static rotation speed, or if you want to modify it on the fly.
In the first case, you can change the GPSPEED's lotag in EVENT_LOADACTOR or an eventloadactor block.
After premap, where these are run from, all GPSPEED sprites are deleted and their former lotags are assigned to their containing sector's .extra member. Thus, for the dynamic speed control, you could change that one in intervals. The GPSPEED lotag -> sector extra backup is somewhat of an implementation detail, but it's unlikely to ever change.
Also note that for SE0/SE1 constructions, the GPSPEEDs are placed in the SE1 (actual rotating sector) instead of the matching SE0 (pivot). Thus, you must be prepared to change all speeds belonging to one pivot to the same value.
#1327 Posted 21 June 2013 - 06:27 AM
#1328 Posted 29 June 2013 - 03:21 AM
For example i start a boss fight and another track starts, using strattrack #... i save... when i load i get back to normal level music... how to avoid this ?
#1329 Posted 29 June 2013 - 05:17 AM
#1330 Posted 29 June 2013 - 05:23 AM
RichardStorm, on 29 June 2013 - 03:21 AM, said:
Well you should use starttrackvar instead of starttrack, and then set the currently playing track as a variable. Then to avoid the problem of reverting to the "normal level music" upon loading, you should put a check in EVENT_LOADGAME event.
#1331 Posted 29 June 2013 - 06:04 AM
gamevar musicVolume -1 1 gamevar musicLevel -1 1 state reset_music setvar musicVolume -1 setvar musicLevel -1 ends state trigger_music ifvarg musicVolume -1 setuserdef[THISACTOR].volume_number musicVolume ifvarg musicLevel -1 starttrackvar musicLevel // always reset to the proper value setuserdef[THISACTOR].volume_number VOLUME ends onevent EVENT_RESETPLAYER state reset_music endevent onevent EVENT_ENTERLEVEL state reset_music endevent onevent EVENT_LOADGAME state trigger_music endevent
To change a track, you would set the variables and then call state trigger_music. I used per-player variables for Sonic 3D so that something like an invincibility jingle would only affect the player with it.
#1332 Posted 30 June 2013 - 07:38 AM
I know I should be posting the code but I don't want to give away some info contained in it and spoil the suprise for future players. I'm basically asking if I'm on the wrong trail trying to use the "resetactioncount" instead of something else.
I also figured out how to have something spawn from the actor after the hit but I have a slight problem. The item spawns at the same location as the actor that spawned it. Because of mapping issues I need the spawned item to be at a slightly higher elevation to clear an obstacle. How would I go about doing that?
#1333 Posted 30 June 2013 - 11:00 AM
For the second part, do you need it to just spawn higher up, or away from the model altogether? If it's the former, try:
getactor[THISACTOR].z TEMP espawn WHATYOUWANTTOSPAWN subvar TEMP 4096 // This will move it up a bit setactor[RETURN].z TEMP
This post has been edited by James: 30 June 2013 - 11:01 AM
#1335 Posted 30 June 2013 - 11:28 AM
#1336 Posted 30 June 2013 - 11:34 AM
#1337 Posted 30 June 2013 - 11:41 AM
EDIT: It moved the spawned sprite down instead of up.

This post has been edited by Mark.: 30 June 2013 - 11:56 AM
#1338 Posted 30 June 2013 - 12:14 PM
action IDLEANIM 0 1 1 1 0
action ANIM2 1 14 1 1 0
useractor notenemy MYACTOR 0
gamevar TEMP 0 2
ifhitweapon
{
strength 0
action ANIM2
sound XXX
getactor[THISACTOR].z TEMP
espawn XXXX
subvar TEMP 4096 // This will move it up a bit
setactor[RETURN].z TEMP
}
enda
This post has been edited by Mark.: 30 June 2013 - 12:16 PM
#1339 Posted 30 June 2013 - 12:25 PM
gamevar TEMP 0 2 // gamevars should be outside of actors useractor notenemy MYACTOR ifhitweapon { strength 1 action ANIM2 sound XXX getactor[THISACTOR].z TEMP espawn XXXX addvar TEMP 4096 // This will move it up a bit setactor[RETURN].z TEMP } enda
#1340 Posted 30 June 2013 - 01:33 PM
BTW, the new item I tested the spawn with was one of my new enemies. I happened to shoot the actor with the machine gun. A whole butt-load of enemies appeared. It was like an episode of Serious Sam.

#1341 Posted 30 June 2013 - 01:47 PM
#1342 Posted 30 June 2013 - 02:10 PM
EDIT: That did it. Having the idle action run after the animation and then break command are what did it. WOO HOO. Thanks again.
Now for my next 24 questions......

This post has been edited by Mark.: 30 June 2013 - 02:27 PM
#1343 Posted 01 July 2013 - 11:01 AM
#1344 Posted 06 July 2013 - 12:18 AM
I can't make move of player in such sectors
Here is a part of my rotator:
//Code for rotation sector ifvare active 1 { setactorvar[THISACTOR].active 0 setvar rot_moving 0 } getactor[THISACTOR].ang ang ifvare rot_turnway 0 { addvarvar ang rot_angspeed ifvarg ang 2047 setvar ang 0 } else ifvare rot_turnway 1 { subvarvar ang rot_angspeed ifvarl ang 0 setvar ang 2048 } subvarvar rot_saveang rot_angspeed setactor[THISACTOR].ang ang //set rotation angle of own sectoreffector sprite. With rotate of this sprite, sector will be rotating too. //Here I trying move a player with the sector together getplayer[THISACTOR].i PLAYERID setvarvar spriteid PLAYERID getactor[spriteid].sectnum se_sector getactor[THISACTOR].sectnum se_sect1 ifvarvare se_sector se_sect1 //if player in a sector { getplayer[THISACTOR].posx x2 getplayer[THISACTOR].posx y2 subvarvar x2 sprite[THISACTOR].x subvarvar y2 sprite[THISACTOR].y mulvarvar x2 x2 mulvarvar y2 y2 addvarvar x2 y2 sqrt x2 se_dist //calculating a distance between player and point of rotate sector setvarvar x2 sprite[THISACTOR].x addvarvar x2 se_dist rotatepoint sprite[THISACTOR].x sprite[THISACTOR].y x2 sprite[THISACTOR].y ang x y setplayer[THISACTOR].posx x setplayer[THISACTOR].posy y //set coodinates of player after rotation }
And of cource, with this code the player can't moving and after some tics player get away from sector.
This post has been edited by M210: 06 July 2013 - 12:19 AM