Free Hero Mesh

Check-in [1ba87a8fa2]
Login
This is a mirror of the main repository for Free Hero Mesh. New tickets and changes will not be accepted at this mirror.
Overview
Comment:Add WARPED message.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 1ba87a8fa2215971456b1c9a54a41f1f121724be
User & Date: user on 2023-05-12 06:43:13
Other Links: manifest | tags
Context
2023-05-17
20:20
Correct some mistakes in the dealing with multibyte characters. check-in: 102b5912d7 user: user tags: trunk
2023-05-12
06:43
Add WARPED message. check-in: 1ba87a8fa2 user: user tags: trunk
2023-05-09
20:06
Implement (untested and incomplete) MBCS character substitutions in popups in exec.c. check-in: b39b71353a user: user tags: trunk
Changes

Modified class.doc from [bd7b7d4360] to [c053f49e1f].

721
722
723
724
725
726
727

728
729
730
731
732
733
734
  LASTIMAGE
  MOVED
  MOVING
  NEXTWARP
  PLAYERMOVING
  POSTINIT
  SUNK

  XCREATE

Input constants:
  'BACK = 8
  'TAB = 9
  'CENTER = 12
  'ENTER = 13







>







721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
  LASTIMAGE
  MOVED
  MOVING
  NEXTWARP
  PLAYERMOVING
  POSTINIT
  SUNK
  WARPED
  XCREATE

Input constants:
  'BACK = 8
  'TAB = 9
  'CENTER = 12
  'ENTER = 13
2604
2605
2606
2607
2608
2609
2610






2611
2612
2613
2614
2615
2616
2617
  has been exchanged with. Arg3 is the return value from the corresponding
  FLOATED message. The other cases this is used is when an object moves or
  is created but is not the least dense object at that location. In this
  case, From is zero, and the return value is not used. For creation, Arg3
  is the return value of the corresponding CREATE message; for movement,
  Arg3 is always zero. (This has nothing to do with sinking in water.)







XCREATE
  This message is received by an object which has been just created due to
  a COLLIDEBY message returning a class. From is the object at the target
  location that a collision with layers occurred (which is now destroyed).
  Arg1 is the class of the attempted creation or object trying to move
  here, Arg2 is the image of the attempted creation or object trying to
  move here, and Arg3 is the object trying to move here (or zero if it was







>
>
>
>
>
>







2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
  has been exchanged with. Arg3 is the return value from the corresponding
  FLOATED message. The other cases this is used is when an object moves or
  is created but is not the least dense object at that location. In this
  case, From is zero, and the return value is not used. For creation, Arg3
  is the return value of the corresponding CREATE message; for movement,
  Arg3 is always zero. (This has nothing to do with sinking in water.)

WARPED
  Sent to an object that has been moved by a warp. From is the warp
  object, Self is the object that has just been moved, and Arg3 is the hit
  value. If the return value is true, then whatever tried to move it
  believes that the move failed.

XCREATE
  This message is received by an object which has been just created due to
  a COLLIDEBY message returning a class. From is the object at the target
  location that a collision with layers occurred (which is now destroyed).
  Arg1 is the class of the attempted creation or object trying to move
  here, Arg2 is the image of the attempted creation or object trying to
  move here, and Arg3 is the object trying to move here (or zero if it was
2755
2756
2757
2758
2759
2760
2761
2762

2763
2764
2765
2766
2767
2768
2769
  to actually move when sliding to the right, both bit25 and bit27 must
  be set, and bit7 must be clear.

bit28 *
  This bit is set by the game engine if a warp has occurred. See the below
  description of warping. You can also set this bit by yourself, and it
  persists across restarts. If this bit is set, the moving object's
  direction is updated after the movement if it is successful.


bit29 *
  Reserved for future.

bit30
  Available for your own use.








|
>







2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
  to actually move when sliding to the right, both bit25 and bit27 must
  be set, and bit7 must be clear.

bit28 *
  This bit is set by the game engine if a warp has occurred. See the below
  description of warping. You can also set this bit by yourself, and it
  persists across restarts. If this bit is set, the moving object's
  direction is updated after the movement if it is successful; this will
  also allow the NEXTWARP and WARPED messages to be sent.

bit29 *
  Reserved for future.

bit30
  Available for your own use.

Modified exec.c from [4959314432] to [40900c6cd3].

1634
1635
1636
1637
1638
1639
1640

1641






1642
1643
1644
1645
1646
1647
1648
  fail:
  if(hit&0x1000) goto success;
  if(hit&0x10000000) {
    v=send_message(obj,objW,MSG_NEXTWARP,NVALUE(dir),NVALUE(0),NVALUE(hit));
    if(v.t || v.u) goto warp;
  }
  o->inertia=0; return 0;

  success: if(!(hit&0x4000)) o->oflags|=OF_MOVED; if(hit&0x10000000) o->dir=dir; return 1;






}

static int jump_to(Uint32 from,Uint32 n,Uint32 x,Uint32 y) {
  int xx,yy;
  if(n==VOIDLINK) return 0;
  xx=objects[n]->x;
  yy=objects[n]->y;







>
|
>
>
>
>
>
>







1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
  fail:
  if(hit&0x1000) goto success;
  if(hit&0x10000000) {
    v=send_message(obj,objW,MSG_NEXTWARP,NVALUE(dir),NVALUE(0),NVALUE(hit));
    if(v.t || v.u) goto warp;
  }
  o->inertia=0; return 0;
  success:
  if(!(hit&0x4000)) o->oflags|=OF_MOVED;
  if(hit&0x10000000) {
    o->dir=dir;
    v=send_message(objW,obj,MSG_WARPED,NVALUE(0),NVALUE(0),NVALUE(hit));
    if(v_bool(v)) return 0;
  }
  return 1;
}

static int jump_to(Uint32 from,Uint32 n,Uint32 x,Uint32 y) {
  int xx,yy;
  if(n==VOIDLINK) return 0;
  xx=objects[n]->x;
  yy=objects[n]->y;

Modified heromesh.h from [cbb8688147] to [cca2629b39].

42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#define CVALUE(x) UVALUE(x,TY_CLASS)
#define MVALUE(x) UVALUE(x,TY_MESSAGE)
#define ZVALUE(x) UVALUE(x,TY_STRING)
#define OVALUE(x) ((x)==VOIDLINK?NVALUE(0):UVALUE(x,objects[x]->generation))
#define ValueTo64(v) (((sqlite3_int64)((v).u))|(((sqlite3_int64)((v).t))<<32))
#define ValueEq(x,y) ((x).t==(y).t && (x).u==(y).u)

#define N_MESSAGES 29
#define N_STANDARD_SOUNDS 49
extern const char*const standard_message_names[];
extern const char*const standard_sound_names[];
extern const char*const heromesh_key_names[256];

extern sqlite3*userdb;
extern xrm_db*resourcedb;







|







42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#define CVALUE(x) UVALUE(x,TY_CLASS)
#define MVALUE(x) UVALUE(x,TY_MESSAGE)
#define ZVALUE(x) UVALUE(x,TY_STRING)
#define OVALUE(x) ((x)==VOIDLINK?NVALUE(0):UVALUE(x,objects[x]->generation))
#define ValueTo64(v) (((sqlite3_int64)((v).u))|(((sqlite3_int64)((v).t))<<32))
#define ValueEq(x,y) ((x).t==(y).t && (x).u==(y).u)

#define N_MESSAGES 30
#define N_STANDARD_SOUNDS 49
extern const char*const standard_message_names[];
extern const char*const standard_sound_names[];
extern const char*const heromesh_key_names[256];

extern sqlite3*userdb;
extern xrm_db*resourcedb;

Modified instruc.h from [852aec28ef] to [ad766f3299].

773
774
775
776
777
778
779

780
781
782
783
784
785
786
{"UserState",8618101},
{"VACUUM",8389410},
{"VisualOnly",8618102},
{"Volume",9142353},
{"VolumeAt",8421602},
{"W",9437188},
{"WAHOO",8389399},

{"WHACK",8389422},
{"Walkable",8487139},
{"Weight",9142355},
{"WinLevel",8487140},
{"XCREATE",8389148},
{"XDir",8487141},
{"XStep",8487142},







>







773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
{"UserState",8618101},
{"VACUUM",8389410},
{"VisualOnly",8618102},
{"Volume",9142353},
{"VolumeAt",8421602},
{"W",9437188},
{"WAHOO",8389399},
{"WARPED",8389149},
{"WHACK",8389422},
{"Walkable",8487139},
{"Weight",9142355},
{"WinLevel",8487140},
{"XCREATE",8389148},
{"XDir",8487141},
{"XStep",8487142},
888
889
890
891
892
893
894
895
896
{"then",8683531},
{"tmark",8421611},
{"tuck",8421380},
{"uniq",8421618},
{"until",8683534},
{"while",8683535},
};
#define N_OP_NAMES 373
#endif







|

889
890
891
892
893
894
895
896
897
{"then",8683531},
{"tmark",8421611},
{"tuck",8421380},
{"uniq",8421618},
{"until",8683534},
{"while",8683535},
};
#define N_OP_NAMES 374
#endif

Modified names.h from [256a5051e1] to [7ff55d411f].

24
25
26
27
28
29
30

31
32
33
34
35
36
37
#define MSG_COLLIDE 22
#define MSG_COLLIDING 23
#define MSG_BLOCKED 24
#define MSG_CONNECT 25
#define MSG_NEXTWARP 26
#define MSG_CLICK 27
#define MSG_XCREATE 28

#ifdef HEROMESH_MAIN
const char*const standard_message_names[]={
 "INIT",
 "CREATE",
 "DESTROY",
 "BEGIN_TURN",
 "ARRIVED",







>







24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#define MSG_COLLIDE 22
#define MSG_COLLIDING 23
#define MSG_BLOCKED 24
#define MSG_CONNECT 25
#define MSG_NEXTWARP 26
#define MSG_CLICK 27
#define MSG_XCREATE 28
#define MSG_WARPED 29
#ifdef HEROMESH_MAIN
const char*const standard_message_names[]={
 "INIT",
 "CREATE",
 "DESTROY",
 "BEGIN_TURN",
 "ARRIVED",
55
56
57
58
59
60
61

62
63
64
65
66
67
68
 "COLLIDE",
 "COLLIDING",
 "BLOCKED",
 "CONNECT",
 "NEXTWARP",
 "CLICK",
 "XCREATE",

};
const char*const standard_sound_names[]={
 "SPLASH",
 "POUR",
 "DOOR",
 "GLASS",
 "BANG",







>







56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
 "COLLIDE",
 "COLLIDING",
 "BLOCKED",
 "CONNECT",
 "NEXTWARP",
 "CLICK",
 "XCREATE",
 "WARPED",
};
const char*const standard_sound_names[]={
 "SPLASH",
 "POUR",
 "DOOR",
 "GLASS",
 "BANG",

Modified names.js from [c748daa1b0] to [c026ba45a4].

29
30
31
32
33
34
35

36
37
38
39
40
41
42
 22 = COLLIDE
 23 = COLLIDING
 24 = BLOCKED
 25 = CONNECT
 26 = NEXTWARP
 27 = CLICK
 28 = XCREATE

`.split("\n").map(x=>/^ *([0-9]+) = ([^ ]*) *$/.exec(x)).filter(x=>x);
const standard_sound_names=[];
`
 SPLASH
 POUR
 DOOR
 GLASS







>







29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
 22 = COLLIDE
 23 = COLLIDING
 24 = BLOCKED
 25 = CONNECT
 26 = NEXTWARP
 27 = CLICK
 28 = XCREATE
 29 = WARPED
`.split("\n").map(x=>/^ *([0-9]+) = ([^ ]*) *$/.exec(x)).filter(x=>x);
const standard_sound_names=[];
`
 SPLASH
 POUR
 DOOR
 GLASS