Jump to content

Scriting help


ger4

Recommended Posts

Posted

If anyone can help, I basically need to find a way to call update3d on all the npcs in the cell the player is in as well as the player themselves at the same time in a script.

 

Thanks  :cool:

Guest ThatOne
Posted

You could use an array if it has to be exactly "at the same time"...

Check each ref around the player (getnextref I guess?), check if they are in an active (loaded) cell at the time the script checks, add all those refs to an array and, once done, call update3d on all refs in the array.

Note that if any actors change their cells to ones that aren't loaded you may need to make a secondary check (at the time you call update3d).

 

If it doesn't have to be exactly at the same time, you could call update3d on each actor individually (instead of the array). This would also eliminate the issue of actors changing cells.

 

To find which cell the player is in, you can try GetInCell or GetCurrentRegions. Not sure about the second one as I've never used it (but it seems like it could be related).

 

Sorry if that wasn't too helpful, I haven't scripted anything in a long time (currently playing DotA 2).

Posted

Don't worry, WappyOne already gave me a useful script anyway to work with since I am a complete scripting noob and can't do arrays.

 

 I've had another think an i think the best option would be to create a script that loops back on itself until it detects there are no more couples having sex in the current cell. If someone could write this one for me/give me a rough outline I would be very grateful  :)

 

Specifically, I need a script that updates the 3d of all actors in a cell after a sex scene has finished, but if their are multiple sex scenes, it must wait from them to finish too before calling update3d.

Posted

as spell

 

 

 

scn aaActHelper

int ss
short anum
short n
short tr
ref acr


begin scripteffectstart

let anum:=getnumrefs 69
if anum!=0

let acr:=getfirstref 69
let n:=0


while (n<anum)
if acr.getdistance player<9333&&acr.getdisabled==0
acr.update3d
endif
let n:=n+1
let acr:=getnextref
loop
endif
endif

end

Posted

as spell

 

 

 

scn aaActHelper

 

int ss

short anum

short n

short tr

ref acr

 

 

begin scripteffectstart

 

let anum:=getnumrefs 69

if anum!=0

 

let acr:=getfirstref 69

let n:=0

 

 

while (n<anum)

if acr.getdistance player<9333&&acr.getdisabled==0

acr.update3d

endif

let n:=n+1

let acr:=getnextref

loop

endif

endif

 

end

Thanks TDA :)

 

Although i haven't been able to use your code, I just wanted to say I have released another version of loversetscale and that i really appreciate your help.

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...