cleffect beam_update doesn't seem to work

greatguys1

Epic Adventurer
MSC Developer
Warriors of the North
MSC Archivist
Joined
Apr 20, 2013
Messages
339
Reaction score
60
Age
26
Location
Yes
Sometimes it seems to update, but only once, despite trying many times & putting it on timers, etc.
beam_update.PNG

I can, however, get properties properly.

Code:
{ effect_beam_point_update //Called every frame

    callevent resolve_positions
    //infomsg all $getcl_beam(BEAM_ID,end) $getcl_beam(BEAM_ID,width)
    //Appears to be able to get properties properly

    //Tried on timer, in separate event, without quotes
    cleffect beam_update BEAM_ID "start" START_POS
    cleffect beam_update BEAM_ID "end" END_POS
}

{ resolve_positions //Will get the new positions for the tempents to go

    add TEST_ANG 2

    setvard START_POS $getcl(START_IDX,origin)
    vectoradd START_POS $relpos($getcl(START_IDX,angles),START_OFFS) //Adds the position relative to the angle

    //setvard END_POS $getcl(END_IDX,origin)
    //vectoradd END_POS $relpos($getcl(END_IDX,angles),END_OFFS)

    //TESTANGS
    setvard END_POS $getcl(START_IDX,origin)
    vectoradd END_POS $relpos($vec(0,TEST_ANG,0),$vec(0,50,0))
}

EDIT: Just to clarify, this was done in a client side script
EDIT: I did try the width property too, but no others besides start and end.
EDIT: I should've expected this. I think I read somewhere that these don't work. If absolutely nothing can be done, I'll just make another fx. All I'm trying to do is have beam points follow the center of a monster, not the origin
EDIT again: The script provided is a snippet of the fx, it should beam from the center of START_IDX then spin the end position around it in a circle. I did this just to test if it was even working.
 
Last edited:

Thothie

Administrator
Staff member
Administrator
Moderator
MSC Archivist
Joined
Apr 8, 2005
Messages
16,342
Reaction score
326
Location
lost
Dun think this function was actually tested... I can *kinda* get it to work, if I update both the start and end position - issue being, beam keeps its orientation. So if I have a beam that goes straight up and down, and try to move the end position in a circle and the start in the opposite angle, what I get is a straight beam moving around its axis, instead of a beam with two ends twisting around its axis, as one would expect.

Now there's also this mysterious "delta" factor - if I move that in the same fashion that I move the beam start, the beam turns on its side, and I get a kinda clock-hand effect, as the beam rotates around the axis.

Code looks fine, but it maybe these properties dun do what one would expect.

Actual test script I used (0x0x0 is exposed in walltest):
Code:
{ cl_beam_test
	cleffect beam_points (0,0,0) (0,0,64) lgtning.spr 999.9 2.0 0.01 1 1 30 (1,1,0,1)
	setvard TEST_BEAM game.script.last_beam_id
	setvard ROT_ANG 0
	callevent 0.5 cl_beam_test_loop
}

{ cl_beam_test_loop
	callevent 0.5 cl_beam_test_loop
	
	dbg cl_beam_test_loop TEST_BEAM $getcl_beam(TEST_BEAM,end)

	local L_END_VEC $vec(0,0,64)
	vectoradd L_END_VEC $relpos($vec(0,ROT_ANG,0),$vec(0,128,0))
	cleffect beam_update TEST_BEAM end L_END_VEC //this alone has no effect
	local L_START_VEC $vec(0,0,0)
	local L_ROT_ANG ROT_ANG
	add L_ROT_ANG 180
	vectoradd L_START_VEC $relpos($vec(0,L_ROT_ANG,0),$vec(0,128,0))
	cleffect beam_update TEST_BEAM start L_START_VEC //rotates the entire beam, but does not change angles
	cleffect beam_update TEST_BEAM delta L_START_VEC //puts beam on its side, radiating angles
	add ROT_ANG 20
	if ROT_ANG > 359
	setvard ROT_ANG 0
}

If I adjust the delta and the start or the end, I can move one end of the beam, as directed, but not the other.... Hrmmm...
 
Top