Jump to content


Photo

fj_schedule


  • Please log in to reply
4 replies to this topic

#1 PsychoWedge

PsychoWedge
  • Member
  • 2 posts

Posted 16 June 2014 - 03:18 AM

Hey there

 

I just discovered the fj_are_structure function in the weidu manual and I like it very much. xD So I add an actor to an area and that works flawlessly. But I don't understand how fj_schedule is supposed to work. In the manual it is written that the bits to use are 0-23 which I assumed to be the hours of the day which would coincide with the 24 flags for the hours for an actor in an area. I'd like for my NPC to be present from 8:30 to 20:29 but whatever number I write after fj_schedule it only flags flags between 00:30 and 04:30. Sometimes it flags more than one, sometimes it flags only one. I've gone through all 24 numbers but I don't get anything usefull.

 

Can somebody explain to me what I miss? ^^

 

 

Btw, this is my code with 18 as an example for fj_schedule :

 

COPY_EXISTING ~ar6700.are~ ~override~
  LPF fj_are_structure
    INT_VAR
    fj_loc_x          = 1917
    fj_loc_y          = 1561
    fj_dest_x         = 1917
    fj_dest_y         = 1561
    fj_animation      = 0xC710
    fj_orientation    = 3
    fj_schedule       = 18
    STR_VAR
    fj_structure_type = actor
    fj_name           = PWzoiya
    fj_cre_resref     = PWzoiya
  END

The 18 flags 01:30-02:29 and 04:30-05:29 but nothing else. If I use 10 for example, it flags 01:30-02:29 and 03:30-04:29 but nothing else.


Edited by PsychoWedge, 16 June 2014 - 03:31 AM.

I want to have an EarToy peripheral, so I can control games with the voices in my head.


#2 The Imp

The Imp

    Not good, see EVIL is better. You'll LIVE.

  • Member
  • 5155 posts

Posted 16 June 2014 - 03:33 AM

The 18 flags 01:30-02:29 and 04:30-05:29 but nothing else. If I use 10 for example, it flags 01:30-02:29 and 03:30-04:29 but nothing else.

It's (likely be a) binary figure if ones is out on a set time reference, the thing you are doing is using a ten base, which is 16+2 or 0b0010 0010 in 2 base (as in binary), you kinda don't see it as equal, but it very much is. If you wish to flag the character to be there 24 hours, you set the number to 4294967295 on the 10 base, or 0xffff ffff, as you can use the hexa base.

Now then to make the creatures schedule to be from 8:30 to 20:29, in binary you have to have the red marked times;

2ajq1oz.jpg (yes, I made a mistake, there's two red dots on one of the things, sue me)

In binary, this is very easy, you put down 0x and 32 zeroes, aka: 0b0000 0000 0000 0000 0000 0000 0000 0000, and then you mark the hour marks according from the top of the picture to the end of the binary number. And as the first red marked dot is on the 9th schedule timer, there's 8 zeroes, then 12 one, and the rest is zeroes again(the last 8 zeroes have no meaning as the schedule ends at the 24th one). So 0b0000 0000 0000 1111 1111 1111 0000 0000. The binary number is easy to convert to the 10 base it you want, with any internet converter, like this, you get 1048320, so you were just a little off with the 18. :devil:


Edited by The Imp, 16 June 2014 - 06:13 AM.

Yep, Jarno Mikkola. my Mega Mod FAQ. Use of the BWS, and how to use it(scroll down that post a bit). 
OK, desert dweller, welcome to the sanity, you are free to search for the limit, it's out there, we drew it in the sand. Ouh, actually it was still snow then.. but anyways.


#3 PsychoWedge

PsychoWedge
  • Member
  • 2 posts

Posted 16 June 2014 - 04:00 AM

I'm sorry but I don't understand what you're saying. I know all the words but I don't know the meaning of them combined in that way... :lol2:

 

I know how to convert between the dec, hexa and binary numbering systems but I don't understand what you mean by 16+2 nor how I would calculate the NPC not being present in the night but being present during the day (which, if you look at it in NI for example, would be the flags 8-19).

 

 

 

EDIT:

Aha. Okay, THIS I do understand more or less. Thank you very much. :)


Edited by PsychoWedge, 16 June 2014 - 04:04 AM.

I want to have an EarToy peripheral, so I can control games with the voices in my head.


#4 The Imp

The Imp

    Not good, see EVIL is better. You'll LIVE.

  • Member
  • 5155 posts

Posted 16 June 2014 - 04:43 AM

I'm sorry but..

Yeah, I was editing the post and ran into a few things that I needed to sort out.


Edited by The Imp, 16 June 2014 - 06:15 AM.

Yep, Jarno Mikkola. my Mega Mod FAQ. Use of the BWS, and how to use it(scroll down that post a bit). 
OK, desert dweller, welcome to the sanity, you are free to search for the limit, it's out there, we drew it in the sand. Ouh, actually it was still snow then.. but anyways.


#5 Mike1072

Mike1072
  • Modder
  • 539 posts

Posted 16 June 2014 - 06:47 AM

Hey there

 

I just discovered the fj_are_structure function in the weidu manual and I like it very much. xD So I add an actor to an area and that works flawlessly. But I don't understand how fj_schedule is supposed to work. In the manual it is written that the bits to use are 0-23 which I assumed to be the hours of the day which would coincide with the 24 flags for the hours for an actor in an area. I'd like for my NPC to be present from 8:30 to 20:29 but whatever number I write after fj_schedule it only flags flags between 00:30 and 04:30. Sometimes it flags more than one, sometimes it flags only one. I've gone through all 24 numbers but I don't get anything usefull.

 

Can somebody explain to me what I miss? ^^

 

If you look at the IESDP .are description, it explains which bits correspond to which times.  Each hour can be set independently.  8:30-9:29 corresponds to bit 8 and 19:30-20:29 corresponds to bit 19, so you want to set all bits between 8 and 19.

 

An easy way to do this in WeiDU is to use the built-in variables.  WeiDU defines BIT0 as 0b1, BIT1 as 0b10, BIT2 as 0b100, all the way up to BIT31.  To set multiple bits, you can use a binary OR operation, which in WeiDU is denoted as BOR or |.

 

Using WeiDU's built-in variables, this expression computes the value of a number where bits 8 through 19 are set:

 

BIT19 | BIT18 | BIT17 | BIT16 | BIT15 | BIT14 | BIT13 | BIT12 | BIT11 | BIT10 | BIT9 | BIT8

 

Alternatively, you could write in that number as 0b11111111111100000000 in binary, 0xfff00 in hexadecimal, or 1048320 in decimal.  The expression or any of these values can be given as the fj_schedule parameter.