EDuke32 Scripting "CON coding help"
#1311 Posted 08 June 2013 - 08:00 AM
#1312 Posted 08 June 2013 - 08:02 AM
LAW, on 08 June 2013 - 05:20 AM, said:
gamevar OWNER 0 0 gamevar PAL 0 0 ifactor MAMA getactor[THISACTOR].owner OWNER ifvare OWNER RESPAWN getactor[OWNER].pal PAL setactor[THISACTOR].pal PAL //OR ifvare PAL 30 spritepal 30
It doesn't work. Is there a workaround to have that enemy appear on demand and do the special actions?
There are some problems with your code. First of all the .owner may be reseted after EVENT_EGS, so you should save it to a gamevar before.
Also shouldn't the code after "ifactor MAMA" be inside of brackets? Without it the code would attempt to change the pal of all sprites, including the RESPAWN ones.
LAW, on 08 June 2013 - 08:00 AM, said:
I think it doesn't apply here since EVENT_GAME runs regardless of the actor being seen yet by player or not.
This post has been edited by Fox: 08 June 2013 - 08:03 AM
#1313 Posted 08 June 2013 - 10:45 AM
Fox, on 08 June 2013 - 08:02 AM, said:
Uh, oh I have forgot about this event - it has soooo unimpressive name
So now everything works like a charm. Thanks Fox. I am a foxy gentleman and I like foxes
#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
endeventTo 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.

Help
Duke4.net
DNF #1
Duke 3D #1


