This repository has been archived by the owner on Apr 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathUnity.cpp
2467 lines (2267 loc) · 98.3 KB
/
Unity.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#include "tilemap.h"
#include "gameobjects.h"
#include "gameobjectsrender.h"
#include <fstream>
#include "main.h"
#include "Unity.h"
#include "textures.h"
void RenderUnityModel(int game, float x, float y, float z, ObjectItem &currobj, ObjectItem objList[1600], tile LevelInfo[64][64]);
void RenderUnitySprite(int game, float x, float y, float z, ObjectItem &currobj, ObjectItem objList[1600], tile LevelInfo[64][64], int billboard);
void RenderUnityEntity(int game, float x, float y, float z, ObjectItem &currobj, ObjectItem objList[1600], tile LevelInfo[64][64]);
void AddShockTriggerActions(int game, float x, float y, float z, ObjectItem &currobj, ObjectItem objList[1600], tile LevelInfo[64][64]);
extern long SHOCK_CEILING_HEIGHT;
extern long UW_CEILING_HEIGHT;
FILE *UNITY_FILE = NULL;
int LevelNo;
void RenderUnityObjectInteraction(int game, float x, float y, float z, ObjectItem &currobj, ObjectItem objList[1600], tile LevelInfo[64][64])
{
fprintf(UNITY_FILE, "\n\tCreateObjectInteraction(myObj,0.5f,0.5f,0.5f,0.5f, \"%s\", \"%s\", \"%s\", %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d);",
objectMasters[currobj.item_id].particle,
objectMasters[currobj.item_id].InvIcon,
objectMasters[currobj.item_id].EquippedIconFemaleLowest,
objectMasters[currobj.item_id].type, currobj.item_id,
currobj.link, currobj.quality, currobj.owner,
objectMasters[currobj.item_id].isMoveable,
objectMasters[currobj.item_id].isSolid,
objectMasters[currobj.item_id].isAnimated,
objectMasters[currobj.item_id].useSprite,
currobj.is_quant,
currobj.enchantment,
currobj.flags,
currobj.InUseFlag
);
}
void RenderUnityObjectInteraction(int game, float x, float y, float z, ObjectItem &currobj, ObjectItem objList[1600], tile LevelInfo[64][64],char *ChildName)
{
fprintf(UNITY_FILE, "\n\tCreateObjectInteraction(myObj,0.5f,0.5f,0.5f,0.5f,\"%s\",\"%s\", \"%s\", %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d \"%s\");",
objectMasters[currobj.item_id].particle,
objectMasters[currobj.item_id].InvIcon,
objectMasters[currobj.item_id].EquippedIconFemaleLowest,
objectMasters[currobj.item_id].type, currobj.item_id,
currobj.link, currobj.quality, currobj.owner,
objectMasters[currobj.item_id].isMoveable,
objectMasters[currobj.item_id].isSolid,
objectMasters[currobj.item_id].isAnimated,
objectMasters[currobj.item_id].useSprite,
currobj.is_quant,
currobj.enchantment,
currobj.flags,
currobj.InUseFlag,
ChildName);
}
void RenderUnityEntityAnimationOverlay(int game, float x, float y, float z, ObjectItem &currobj, ObjectItem objList[1600], tile LevelInfo[64][64])
{//Is animated is treated as the start frame
//useSprite is treated as the length of the animation
fprintf(UNITY_FILE, "\n\tAddAnimationOverlay(myObj,%d,%d);", objectMasters[currobj.item_id].isAnimated, objectMasters[currobj.item_id].useSprite);
}
void RenderUnityEntitySilverSeed(int game, float x, float y, float z, ObjectItem &currobj, ObjectItem objList[1600], tile LevelInfo[64][64])
{//Is animated is treated as the start frame
//useSprite is treated as the length of the animation
fprintf(UNITY_FILE, "\n\tAddSilverSeed(myObj);");
}
void RenderUnityEntityA_MOVE_TRIGGER(int game, float x, float y, float z, ObjectItem &currobj, ObjectItem objList[1600], tile LevelInfo[64][64])
{
//A trigger that fires when you step in it.
//Params
//item_id
//index
//tileX
//tileY
//need to add objectmaster path for generic usage
//Center the object in the tile
x = (currobj.tileX*BrushSizeX + (BrushSizeX/2) )/100.0;
y = (currobj.tileY*BrushSizeY + (BrushSizeY / 2) )/100.0;
if (game == SHOCK)
{//Center vertically in the tile
z= (CEILING_HEIGHT/2)*BrushSizeZ/100.0;
}
else
{
if (currobj.tileX != 99)
{
float newZ = LevelInfo[currobj.tileX][currobj.tileY].floorHeight*BrushSizeZ / 100.0;
if (z < newZ)
{
z=newZ;
}
}
}
RenderUnityModel(game, x, y, z, currobj, objList, LevelInfo);
RenderUnitySprite(game, x, y, z, currobj, objList, LevelInfo, 0);
if (game != SHOCK)
{
fprintf(UNITY_FILE, "\n\tCreateMoveTrigger(myObj,%d,%d,\"%s\");", currobj.quality, currobj.owner, UniqueObjectName(objList[currobj.link]));//set the trigger here
fprintf(UNITY_FILE, "\n\tCreateCollider(myObj,1.20f,1.20f,1.20f);");
RenderUnityObjectInteraction(game, x, y, z,currobj, objList, LevelInfo);
}
else
{
AddShockTriggerActions(game, x, y, z, currobj, objList, LevelInfo);
fprintf(UNITY_FILE, "\n\tCreateEntry_Trigger(myObj, %d,%d,%d,%d,%d,%d);"
, currobj.TriggerAction, currobj.TriggerOnce, currobj.conditions[0], currobj.conditions[1], currobj.conditions[2], currobj.conditions[3]);
fprintf(UNITY_FILE, "\n\tCreateCollider(myObj,1.15f,%ff,1.15f);" , CEILING_HEIGHT * BrushSizeZ/100.0);
}
switch (game)
{
case UWDEMO:
case UW1: //At the corner of the tile
//fprintf(MAPFILE, "\"origin\" \"%d %d %d\"\n", currobj.tileX*BrushSizeX, currobj.tileY*BrushSizeY, LevelInfo[currobj.tileX][currobj.tileY].floorHeight*BrushSizeZ);
break;
case UW2: //Positioned around the triggers origin.
//fprintf(MAPFILE, "\"origin\" \"%f %f %f\"\n", x, y, z);
break;
case SHOCK: //At the corner of the tile.
//fprintf(MAPFILE, "\"origin\" \"%d %d %d\"\n", currobj.tileX*BrushSizeX, currobj.tileY*BrushSizeY, 0);
break;
}
}
void RenderUnityEntityA_PICK_UP_TRIGGER(int game, float x, float y, float z, ObjectItem &currobj, ObjectItem objList[1600], tile LevelInfo[64][64])
{
RenderUnityModel(game, x, y, z, currobj, objList, LevelInfo);
RenderUnitySprite(game, x, y, z, currobj, objList, LevelInfo, 0);
RenderUnityObjectInteraction(game, x, y, z, currobj, objList, LevelInfo);
fprintf(UNITY_FILE, "\n\tCreate_A_PICK_UP_TRIGGER(myObj,%d,%d,\"%s\");", currobj.quality, currobj.owner, UniqueObjectName(objList[currobj.link]));//set the trigger here
}
void RenderUnityEntityBase(int game, float x, float y, float z, ObjectItem &currobj, ObjectItem objList[1600], tile LevelInfo[64][64])
{
//Adds an obj_base to the object.
fprintf(UNITY_FILE, "\n\tAddObj_base(myObj);");
}
void RenderUnityEntityPotion(int game, float x, float y, float z, ObjectItem &currobj, ObjectItem objList[1600], tile LevelInfo[64][64])
{
//Adds an obj_base to the object.
fprintf(UNITY_FILE, "\n\tAddPotion(myObj);");
}
void RenderUnityEntityFountain(int game, float x, float y, float z, ObjectItem &currobj, ObjectItem objList[1600], tile LevelInfo[64][64])
{
//Adds an obj_base to the object.
fprintf(UNITY_FILE, "\n\tAddFountain(myObj);");
}
void RenderUnityEntityShrine(int game, float x, float y, float z, ObjectItem &currobj, ObjectItem objList[1600], tile LevelInfo[64][64])
{
//Adds an obj_base to the object.
fprintf(UNITY_FILE, "\n\tAddShrine(myObj);");
}
void RenderUnityEntityLockpick(int game, float x, float y, float z, ObjectItem &currobj, ObjectItem objList[1600], tile LevelInfo[64][64])
{
//Adds an obj_base to the object.
fprintf(UNITY_FILE, "\n\tAddLockpick(myObj);");
}
void RenderUnityEntityGrave(int game, float x, float y, float z, ObjectItem &currobj, ObjectItem objList[1600], tile LevelInfo[64][64])
{
//Adds an obj_base to the object.
fprintf(UNITY_FILE, "\n\tAddGrave(myObj, %d,%d);",currobj.texture,currobj.DeathWatched);
}
void RenderUnityEntityAnvil(int game, float x, float y, float z, ObjectItem &currobj, ObjectItem objList[1600], tile LevelInfo[64][64])
{
//Adds an obj_base to the object.
fprintf(UNITY_FILE, "\n\tAddAnvil(myObj);");
}
void RenderUnityEntityPole(int game, float x, float y, float z, ObjectItem &currobj, ObjectItem objList[1600], tile LevelInfo[64][64])
{
//Adds an obj_base to the object.
fprintf(UNITY_FILE, "\n\tAddPole(myObj);");
}
void RenderUnityEntityShield(int game, float x, float y, float z, ObjectItem &currobj, ObjectItem objList[1600], tile LevelInfo[64][64])
{
//Adds an obj_base to the object.
fprintf(UNITY_FILE, "\n\tAddShield(myObj);");
}
void RenderUnityEntitySpike(int game, float x, float y, float z, ObjectItem &currobj, ObjectItem objList[1600], tile LevelInfo[64][64])
{
fprintf(UNITY_FILE, "\n\tAddSpike(myObj);");
}
void RenderUnityEntityOil(int game, float x, float y, float z, ObjectItem &currobj, ObjectItem objList[1600], tile LevelInfo[64][64])
{
fprintf(UNITY_FILE, "\n\tAddOil(myObj);");
}
void RenderUnityEntityMoonstone(int game, float x, float y, float z, ObjectItem &currobj, ObjectItem objList[1600], tile LevelInfo[64][64])
{
fprintf(UNITY_FILE, "\n\tAddMoonstone(myObj);");
}
void RenderUnityEntityLeech(int game, float x, float y, float z, ObjectItem &currobj, ObjectItem objList[1600], tile LevelInfo[64][64])
{
fprintf(UNITY_FILE, "\n\tAddLeech(myObj);");
}
void RenderUnityEntityFishingPole(int game, float x, float y, float z, ObjectItem &currobj, ObjectItem objList[1600], tile LevelInfo[64][64])
{
fprintf(UNITY_FILE, "\n\tAddFishingPole(myObj);");
}
void RenderUnityEntityZanium(int game, float x, float y, float z, ObjectItem &currobj, ObjectItem objList[1600], tile LevelInfo[64][64])
{
fprintf(UNITY_FILE, "\n\tAddZanium(myObj);");
}
void RenderUnityEntityBedroll(int game, float x, float y, float z, ObjectItem &currobj, ObjectItem objList[1600], tile LevelInfo[64][64])
{
fprintf(UNITY_FILE, "\n\tAddBedroll(myObj);");
}
void RenderUnityEntityCoin(int game, float x, float y, float z, ObjectItem &currobj, ObjectItem objList[1600], tile LevelInfo[64][64])
{
fprintf(UNITY_FILE, "\n\tAddCoin(myObj);");
}
void RenderUnityEntityBoulder(int game, float x, float y, float z, ObjectItem &currobj, ObjectItem objList[1600], tile LevelInfo[64][64])
{
fprintf(UNITY_FILE, "\n\tAddBoulder(myObj);");
}
void RenderUnityEntityInstrument(int game, float x, float y, float z, ObjectItem &currobj, ObjectItem objList[1600], tile LevelInfo[64][64])
{
fprintf(UNITY_FILE, "\n\tAddInstrument(myObj);");
}
void RenderUnityEntityRing(int game, float x, float y, float z, ObjectItem &currobj, ObjectItem objList[1600], tile LevelInfo[64][64])
{
fprintf(UNITY_FILE, "\n\tAddRing(myObj);");
}
//void RenderUnityEntityRefillableLantern(int game, float x, float y, float z, ObjectItem &currobj, ObjectItem objList[1600], tile LevelInfo[64][64])
// {
// fprintf(UNITY_FILE, "\n\tAddRefillableLantern(myObj);");
// }
void RenderUnityEntityWand(int game, float x, float y, float z, ObjectItem &currobj, ObjectItem objList[1600], tile LevelInfo[64][64])
{
int WandSpellIndex= objList[currobj.link].link;
int WandSpellCharges = objList[currobj.link].quality;
fprintf(UNITY_FILE, "\n\tAddWand(myObj, %d, %d);", WandSpellIndex, WandSpellCharges);
}
void RenderUnityEntityRuneStone(int game, float x, float y, float z, ObjectItem &currobj, ObjectItem objList[1600], tile LevelInfo[64][64])
{//Runestone
RenderUnityModel(game, x, y, z, currobj, objList, LevelInfo);
RenderUnitySprite(game, x, y, z, currobj, objList, LevelInfo, 1);
RenderUnityObjectInteraction(game,x,y,z,currobj,objList,LevelInfo);
fprintf(UNITY_FILE, "\n\tSetObjectAsRuneStone(myObj);");
//SetInventoryIcon
//fprintf(UNITY_FILE, "\n\tSetInventoryIcon(myObj,\"%s\",\"Sprites/%s\");\n", objectMasters[currobj.item_id].InvIcon, objectMasters[currobj.item_id].InvIcon);
}
void RenderUnityEntityRuneBag(int game, float x, float y, float z, ObjectItem &currobj, ObjectItem objList[1600], tile LevelInfo[64][64])
{//Runestone
RenderUnityModel(game, x, y, z, currobj, objList, LevelInfo);
RenderUnitySprite(game, x, y, z, currobj, objList, LevelInfo, 1);
RenderUnityObjectInteraction(game, x, y, z, currobj, objList, LevelInfo);
fprintf(UNITY_FILE, "\n\tSetObjectAsRuneBag(myObj);\n");
}
void RenderUnityEntityPaintingUW(int game, float x, float y, float z, ObjectItem &currobj, ObjectItem objList[1600], tile LevelInfo[64][64])
{//UW2 wall paintings.
RenderUnityModel(game, x, y, z, currobj, objList, LevelInfo);
RenderUnitySprite(game, x, y, z, currobj, objList, LevelInfo, 1);
RenderUnityObjectInteraction(game, x, y, z, currobj, objList, LevelInfo);
}
void CreateUnityScriptCall(int game, float x, float y, float z, ObjectItem &currobj, ObjectItem objList[1600], tile LevelInfo[64][64], char *ScriptName)
{//for objects that start scripts.
//TriggerTargetX = currobj.quality;
//TriggerTargetY = currobj.owner;
//target = objList[nextObj].link
if (game != SHOCK)
{
if (currobj.link != 0)
{//Need to update max state on this
fprintf(UNITY_FILE, "\n\tCreateUWActivators(myObj,\"ButtonHandler\",\"%s\",%d,%d,%d,%d,%d);", UniqueObjectName(objList[currobj.link]), currobj.quality, currobj.owner, currobj.flags, 7, currobj.item_id);
}
else
{
fprintf(UNITY_FILE, "\n\tCreateUWActivators(myObj,\"ButtonHandler\",\"\",%d,%d,%d,%d,%d);", currobj.quality, currobj.owner, currobj.flags, 7, currobj.item_id);
}
}
else
{
//CreateSHOCKActivators(GameObject myObj, int TriggerAction)
fprintf(UNITY_FILE, "\n\tCreateSHOCKActivators(myObj,%d);", currobj.TriggerAction);
}
}
void RenderUnityEntityNPC(int game, float x, float y, float z, ObjectItem &currobj, ObjectItem objList[1600], tile LevelInfo[64][64])
{
//Params
//item_id
//npc_whoami
//npc_attitude
//link for npc inventory in UW
//objectOwnerEntity.
//RenderUnityModel(game,x,y,z,currobj,objList,LevelInfo);
int count=0;
fprintf(UNITY_FILE, "\n\tmyObj = new GameObject(\"%s\");", UniqueObjectName(currobj));//Create the object
fprintf(UNITY_FILE, "\n\tpos = new Vector3(%ff, %ff, %ff);", x, z, y);//Create the object x,z,y
fprintf(UNITY_FILE, "\n\tmyObj.transform.position = pos;");//Position the object
fprintf(UNITY_FILE, "\n\tmyObj.transform.parent = LevelParent;");//Parent the object
//fprintf(UNITY_FILE, "\n\tsi = myObj.AddComponent<StoreInformation>();");
//fprintf(UNITY_FILE, "\n\tsi.Id = myObj.name + \"_ID\";");
fprintf(UNITY_FILE, "\n\tCreateNPC(myObj,\"%d\",\"%s\", %d);", currobj.item_id, objectMasters[currobj.item_id].particle, currobj.npc_whoami);
RenderUnityObjectInteraction(game, x, y, z, currobj, objList, LevelInfo);
/*Set NPC Properties*/
if ((game == UW1) || (game == UWDEMO))
{
fprintf(UNITY_FILE, "\n\tSetNPCProps(myObj, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, " ,
currobj.npc_whoami, currobj.npc_xhome, currobj.npc_yhome,
currobj.npc_hunger, currobj.npc_health,
currobj.npc_hp, currobj.npc_arms, currobj.npc_power,
currobj.npc_goal, currobj.npc_attitude, currobj.npc_gtarg,
currobj.npc_talkedto, currobj.npc_level, currobj.npc_name
);
if (currobj.npc_gtarg > 1)
{//Does not occur in UW1
fprintf(UNITY_FILE, "\"%s\" , ",UniqueObjectName(objList[currobj.npc_gtarg]));//Gtarget string
}
else
{
fprintf(UNITY_FILE, "\"\" , ");//Gronk
}
if ((currobj.tileX != 99) && (currobj.tileY != 99))
{
if (LevelInfo[currobj.tileX][currobj.tileY].isLava==1)
{
fprintf(UNITY_FILE, "\"_LavaMesh_%d_%d\");", LevelNo, LevelInfo[currobj.tileX][currobj.tileY].lavaRegion);
}
else if (LevelInfo[currobj.tileX][currobj.tileY].isWater == 1)
{
fprintf(UNITY_FILE, "\"_WaterMesh_%d_%d\");", LevelNo, LevelInfo[currobj.tileX][currobj.tileY].waterRegion);
}
else
{
//if (LevelInfo[currobj.tileX][currobj.tileY].landRegion >= 31)
//// {
// fprintf(UNITY_FILE, "\"_GroundMesh_%d_%d\");", LevelNo, 30);
// }
//else
//{
fprintf(UNITY_FILE, "\"_GroundMesh_%d_%d\");", LevelNo, LevelInfo[currobj.tileX][currobj.tileY].landRegion);
//}
}
/*switch (currobj.item_id)//Split into my known fliers,swimmers and walkers.. TODO: Make this better!
{
case 66://bat
case 73://vampire bat
fprintf(UNITY_FILE, "\"SkyMesh1\");");//Fliers can go anywhere. Need to create this mesh.
break;
case 87://lurker
case 116://deep lurker
fprintf(UNITY_FILE, "\"WaterMesh%d\");", LevelInfo[currobj.tileX][currobj.tileY].waterRegion);
break;
default:
if (LevelInfo[currobj.tileX][currobj.tileY].landRegion >= 21)
{
fprintf(UNITY_FILE, "\"GroundMesh%d\");", 20);
}
else
{
fprintf(UNITY_FILE, "\"GroundMesh%d\");", LevelInfo[currobj.tileX][currobj.tileY].landRegion);
}
break;
}*/
}
else
{
fprintf(UNITY_FILE, "\"_GroundMesh_%d_%d\");",LevelNo, 1);
}
}
/*
(GameObject myObj,
int WhoAmI, int npc_xhome, int npc_yhome,
int npc_hunger, int npc_health,
int npc_hp, int npc_arms, int npc_power ,
int npc_goal, int npc_attitude, int npc_gtarg,
int npc_talkedto, int npc_level,int npc_name)
*/
if (game != SHOCK)
{
UnityRotation(game, 0, currobj.heading, 0);
}
else
{
UnityRotation(game, currobj.Angle1, currobj.Angle2, currobj.Angle3);
}
fprintf(UNITY_FILE, "\n\t////Container contents");
fprintf(UNITY_FILE, "\n\tParentContainer = CreateContainer(myObj, %d, %d, %d);"
, 255
, 255
, 255
);
//now recursively get it's contents.
if (currobj.link != 0) //Container has objects
{
fprintf(UNITY_FILE, "\n\t////NPC container with items\n");
ObjectItem tmpobj = objList[currobj.link];
int count = 0;
fprintf(UNITY_FILE, "\n\tAddObjectToContainer(\"%s\", ParentContainer, %d);",UniqueObjectName(tmpobj), count++);
while (tmpobj.next != 0)
{
tmpobj = objList[tmpobj.next];
fprintf(UNITY_FILE, "\n\tAddObjectToContainer(\"%s\", ParentContainer, %d);", UniqueObjectName(tmpobj), count++);
}
fprintf(UNITY_FILE, "\n\t////Container contents complete\n");
}
return;
}
void RenderUnityEntityDoor(int game, float x, float y, float z, ObjectItem &currobj, ObjectItem objList[1600], tile LevelInfo[64][64])
{
//Params
//item_id
//tileX
//tileY
//Link for a lock
int hasLock = 0;
fprintf(UNITY_FILE, "\n\tmyObj = new GameObject(\"door_%03d_%03d\");",currobj.tileX, currobj.tileY);//Create the object
switch (currobj.heading)
{//Move the object position so it can located in the right position in the centre of the frame.
case WEST:
y = (currobj.tileY*BrushSizeY + DOORWIDTH + ((BrushSizeY - DOORWIDTH) / 2)) / 100.0;
break;
case EAST:
y = (currobj.tileY*BrushSizeY + ((BrushSizeY - DOORWIDTH) / 2)) / 100.0;
break;
case NORTH:
x = (currobj.tileX*BrushSizeX + DOORWIDTH + ((BrushSizeX - DOORWIDTH) / 2)) / 100.0;
break;
case SOUTH:
x = (currobj.tileX*BrushSizeX + ((BrushSizeX - DOORWIDTH) / 2)) / 100.0;
break;
}
fprintf(UNITY_FILE, "\n\tpos = new Vector3(%ff, %ff, %ff);", x, z, y);//Create the object x,z,y
fprintf(UNITY_FILE, "\n\tmyObj.transform.position = pos;");//Position the object
fprintf(UNITY_FILE, "\n\tmyObj.transform.parent = LevelParent;");//Parent the object
RenderUnityObjectInteraction(game, x, y, z, currobj, objList, LevelInfo);
if (game != SHOCK)
{//bit 0-6 of the lock objects link is the keyid for opening it in uw
// The flags control the lock state
if (currobj.link != 0)
{
if (objectMasters[objList[currobj.link].item_id].type == LOCK)
{
hasLock = 1;
}
}
}
if (game != SHOCK)
{
int isOpen=0;
int OpenAdju=0;
if ((currobj.item_id >= 328) && (currobj.item_id <= 335))
{//Open doors or portcullis
isOpen = 1;
if (currobj.item_id < 334)
{//Don't adjust the open portcullis
OpenAdju = 90;
}
}
switch (objectMasters[currobj.item_id].type)
{//TODO:game versions.
case DOOR:
fprintf(UNITY_FILE, "\n\tCreateDoor(myObj, _RES + \"/textures/doors/doors_%02d_material\", %d, %d, %d);",
objectMasters[currobj.item_id].extraInfo, objList[currobj.link].link & 0x3F,
hasLock,isOpen);
break;
case HIDDENDOOR:
fprintf(UNITY_FILE, "\n\tCreateDoor(myObj, _RES + \"/materials/tmap/%s\", %d, %d, %d);",
textureMasters[LevelInfo[currobj.tileX][currobj.tileY].wallTexture].path,
objList[currobj.link].link & 0x3F,
hasLock, isOpen);
break;
case PORTCULLIS:
fprintf(UNITY_FILE, "\n\tCreatePortcullis(myObj, %d, %d, %d);",
objList[currobj.link].link & 0x3F,
hasLock, isOpen);
break;
}
UnityRotation(game, -90, currobj.heading - 180 + OpenAdju, 0);
}
else
{
UnityRotation(game, currobj.Angle1, currobj.Angle2, currobj.Angle3);
}
if ((currobj.link != 0) && (hasLock==0))
{//Object has a link but not to a lock object. Therefore this is probably a use trigger.
objList[currobj.link].InUseFlag=1;//Make sure the link is rendered
fprintf(UNITY_FILE,"\n\tAddDoorLink(myObj, \"%s\");",UniqueObjectName(objList[currobj.link]));
}
else
{
if (currobj.link != 0)
{
if (hasLock == 1)
{
if (objList[currobj.link].next != 0)
{
if (isTrigger(objList[objList[currobj.link].next]))
{//Try and find a trigger attached to the lock object on this door.
fprintf(UNITY_FILE, "\n\tAddDoorLink(myObj, \"%s\");", UniqueObjectName(objList[objList[currobj.link].next]));
objList[objList[currobj.link].next].InUseFlag=1;
}
}
}
}
}
return;
}
void RenderUnityEntitySHOCKDoor(int game, float x, float y, float z, ObjectItem &currobj, ObjectItem objList[1600], tile LevelInfo[64][64])
{
//Centre the door within the tile depending on it's angles.
if (currobj.Angle1 == 0)//In rare cases doors are on the floor.
{
z = LevelInfo[currobj.tileX][currobj.tileY].floorHeight*BrushSizeZ / 100.0;
switch (currobj.Angle2)
{
case SHOCK_NORTH:
case SHOCK_SOUTH:
x=(currobj.tileX*BrushSizeX + BrushSizeX/2) /100.0;
break;
case SHOCK_EAST:
case SHOCK_WEST:
y = (currobj.tileY*BrushSizeY + BrushSizeY / 2) / 100.0;
break;
}
}
else
{//A flat door on the ground. Center in the tile.
x = (currobj.tileX*BrushSizeX + BrushSizeX / 2) / 100.0;
y = (currobj.tileY*BrushSizeY + BrushSizeY ) / 100.0;
}
RenderUnityModel(game, x, y, z, currobj, objList, LevelInfo);
RenderUnitySprite(game, x, y, z, currobj, objList, LevelInfo, 0);
SetScale(1.9f, 1.9f, 1.9f);//1.875f
UnityRotation(game,currobj.Angle1,currobj.Angle2,currobj.Angle3);
//RenderUnityObjectInteraction(game, x, y, z, currobj, objList, LevelInfo);
////Lock stuff
//if ((currobj.link != 0) || (currobj.SHOCKLocked > 0)) //door has a lock. bit 0-6 of the lock objects link is the keyid for opening it in uw
// {
// //the door is locked
// if ((currobj.link > 0) && (currobj.link <= 11)) //Only this many keycards
// {
// //What keys open this door.
// }
// }
if ((currobj.link != 0) || (currobj.SHOCKLocked > 0))
{//Door is locked
if ((currobj.link > 0) && (currobj.link <= 11))//Valid range of keycards
{
fprintf(UNITY_FILE, "\n\tCreateShockDoor(myObj,%d,%d,%s);", currobj.link, 1, objectMasters[currobj.item_id].path);
}
else
{
fprintf(UNITY_FILE, "\n\tCreateShockDoor(myObj,%d,%d,%s);", -1, 1, objectMasters[currobj.item_id].path);
}
}
else
{//Door is unlocked
fprintf(UNITY_FILE, "\n\tCreateShockDoor(myObj,%d,%d,%s);", currobj.link, 0, objectMasters[currobj.item_id].path);
}
//if ((currobj.link != 0) || (currobj.SHOCKLocked >0) && (game != SHOCK))
// {
// //if it has a lock it needs a lock object for scripting purposes
// }
}
void RenderUnityEntityKey(int game, float x, float y, float z, ObjectItem &currobj, ObjectItem objList[1600], tile LevelInfo[64][64])
{
//Creates a key. Each key is uniquely named based on a counter. Doors will have a list of potential matching key names to work with keys.
//Params
//Item_id
//Owner
//A key's owner id matches it's lock link id.
RenderUnityModel(game, x, y, z, currobj, objList, LevelInfo);
RenderUnitySprite(game, x, y, z, currobj, objList, LevelInfo, 1);
RenderUnityObjectInteraction(game, x, y, z, currobj, objList, LevelInfo);
fprintf(UNITY_FILE, "\n\tCreateKey(myObj, %d);",currobj.owner);
return;
}
void RenderUnityEntityContainer(int game, float x, float y, float z, ObjectItem &currobj, ObjectItem objList[1600], tile LevelInfo[64][64])
{
//Creates something that holds objects.
//Params.
//Item_id
//link //To check for a lock and it's list of contents.
if (game != SHOCK)
{
RenderUnityModel(game, x, y, z, currobj, objList, LevelInfo);
RenderUnitySprite(game, x, y, z, currobj, objList, LevelInfo, 1);
RenderUnityObjectInteraction(game, x, y, z, currobj, objList, LevelInfo);
fprintf(UNITY_FILE, "\n\t////Container contents");
fprintf(UNITY_FILE, "\n\tParentContainer = CreateContainer(myObj, %d, %d, %d);"
, objectMasters[currobj.item_id].uwProperties[UW_PROP_CONT_CAPACITY]
, objectMasters[currobj.item_id].uwProperties[UW_PROP_CONT_SLOTS]
, objectMasters[currobj.item_id].uwProperties[UW_PROP_CONT_OBJECTS]
);
//fprintf(UNITY_FILE, "\n\tmyObj.GetComponent<ObjectInteraction>().isContainer = true;");
if (objectMasters[objList[currobj.link].item_id].type == LOCK) //container has a lock.
{//bit 1 of the flags is the lock?
//Container is locked
}
//now recursively get it's contents.
if (currobj.link != 0) //Container has objects
{
ObjectItem tmpobj = objList[currobj.link];
int count = 0;
if (objectMasters[tmpobj.item_id].type != LOCK)
{
fprintf(UNITY_FILE, "\n\tAddObjectToContainer(\"%s\", ParentContainer, %d);", UniqueObjectName(tmpobj), count++);
}
while (tmpobj.next != 0)
{
tmpobj = objList[tmpobj.next];
fprintf(UNITY_FILE, "\n\tAddObjectToContainer(\"%s\", ParentContainer, %d);", UniqueObjectName(tmpobj), count++);
//tmpobj = objList[tmpobj.next];
}
}
fprintf(UNITY_FILE, "\n\t////Container contents complete\n");
return;
}
else
{
//Shock container. contents are different from uw1
RenderUnityModel(game, x, y, z, currobj, objList, LevelInfo);
RenderUnitySprite(game, x, y, z, currobj, objList, LevelInfo, 1);
if (hasContents(currobj))
{
////createScriptCall(currobj, x, y, z);
////create 4 spawn points around the container to spawn the contents at.
//int offX = 10; int offY = 10;
//for (int i = 0; i < 4; i++)
// {
// switch (i)
// {
// case 0: offX = 10; offY = 10; break;
// case 1: offX = -10; offY = 10; break;
// case 2: offX = 10; offY = -10; break;
// case 3: offX = -10; offY = -10; break;
// }
// if (currobj.shockProperties[CONTAINER_CONTENTS_1 + i] != 0)
// {
// fprintf(MAPFILE, "\n// entity %d\n{\n", EntityCount++);
// fprintf(MAPFILE, "\"classname\" \"%s\"\n", "target_null");
// fprintf(MAPFILE, "\"name\" \"%s_spawnpoint_%d\"\n", UniqueObjectName(currobj), i);
// fprintf(MAPFILE, "\"origin\" \"%f %f %f\"\n", x + offX, y + offY, z);
// fprintf(MAPFILE, "}");
// }
// }
}
}
}
void RenderUnityEntityActivator(int game, float x, float y, float z, ObjectItem &currobj, ObjectItem objList[1600], tile LevelInfo[64][64])
{//Something in the game world that can fire off events
RenderUnityModel(game, x, y, z, currobj, objList, LevelInfo);
RenderUnitySprite(game, x, y, z, currobj, objList, LevelInfo, 1);
CreateUnityScriptCall(game,x,y,z,currobj,objList,LevelInfo,"ButtonHandler");
RenderUnityObjectInteraction(game,x,y,z,currobj,objList,LevelInfo);
return;
}
void RenderUnityEntityButton(int game, float x, float y, float z, ObjectItem &currobj, ObjectItem objList[1600], tile LevelInfo[64][64])
{
//
//Params
//item_id
//tileX
//tileY
//index
//heading
//Need to pass desc/path for generic handling
RenderUnityModel(game, x, y, z, currobj, objList, LevelInfo);
RenderUnitySprite(game, x, y, z, currobj, objList, LevelInfo, 0);
if (game != SHOCK)
{
RenderUnityObjectInteraction(game, x, y, z, currobj, objList, LevelInfo);
CreateUnityScriptCall(game, x, y, z, currobj, objList, LevelInfo, "ButtonHandler");
UnityRotation(game, 0, currobj.heading, 0);
}
else
{
RenderUnityObjectInteraction(game, x, y, z, currobj, objList, LevelInfo);
CreateUnityScriptCall(game, x, y, z, currobj, objList, LevelInfo, "ShockButtonHandler");
AddShockTriggerActions(game, x, y, z, currobj, objList, LevelInfo);
UnityRotation(game, currobj.Angle1, currobj.Angle2, currobj.Angle3);
}
//Set the on/off artwork.
switch (game)
{
case UWDEMO:
case UW1:
if ((currobj.item_id >= 368) && (currobj.item_id <= 375))
{//Button is a turned off one.
SetButtonProperties(game, 0, currobj.item_id - 368, currobj.item_id - 368 + 8);
}
else if((currobj.item_id >= 376) && (currobj.item_id <= 383))
{//Button is a turned on one.
SetButtonProperties(game, 1, currobj.item_id - 368, currobj.item_id - 368 - 8);
}
else if ((currobj.item_id == 353))//Rotary Switch
{
SetButtonProperties(game, 4);
}
else if ((currobj.item_id == 354))//Rotary Switch
{
SetButtonProperties(game, 12);
}
break;
case UW2:
break;
case SHOCK:
break;
}
return;
}
void SetButtonProperties(int game, short on, int SpriteNoOn, int SpriteNoOff)
{
switch (game)
{
case UWDEMO:
case UW1:
fprintf(UNITY_FILE, "\n\tSetButtonProperties(myObj, %d, \"UW1/Sprites/tmflat/tmflat_00%02d\", \"UW1/Sprites/tmflat/tmflat_00%02d\");", on, SpriteNoOn,SpriteNoOff);
break;
case UW2:
break;
case SHOCK:
break;
}
}
void SetButtonProperties(int game, int SpriteNoBegin)
{//For rotary buttons.
fprintf(UNITY_FILE, "\n\tSetButtonProperties(myObj,");
switch (game)
{
case UWDEMO:
case UW1:
for (int i = 0; i < 8; i++)
{
fprintf(UNITY_FILE, "\"UW1/Sprites/tmobj/tmobj_%02d\"",i+SpriteNoBegin);
if (i != 7)
{
fprintf(UNITY_FILE, ",");
}
}
fprintf(UNITY_FILE, ");");
break;
case UW2:
break;
case SHOCK:
break;
}
}
void RenderUnityEntityA_DO_TRAP(int game, float x, float y, float z, ObjectItem &currobj, ObjectItem objList[1600], tile LevelInfo[64][64])
{
return;
//This is a trigger in UW that can do a bunch of different things. Eg cameras/rising platforms.
switch (currobj.quality)
{
case 2: //A camera
RenderUnityModel(game, x, y, z, currobj, objList, LevelInfo);
RenderUnitySprite(game, x, y, z, currobj, objList, LevelInfo, 1);
//fprintf(MAPFILE, "\n// entity %d\n{\n", EntityCount);
//fprintf(MAPFILE, "\"classname\" \"func_cameraview\"\n");
//fprintf(MAPFILE, "\"name\" \"%s_%03d_%03d\"\n", objectMasters[currobj.item_id].desc, currobj.tileX, currobj.tileY);
//fprintf(MAPFILE, "\"origin\" \"%f %f %f\"\n", x, y, z);
//fprintf(MAPFILE, "\"trigger\" \"1\"\n");
////Aim the camera.
//EntityRotation(currobj.heading);//TODO:Points in wrong direction
//fprintf(MAPFILE, "\n}");
//EntityCount++;
break;
case 3: //rising platform
RenderUnityModel(game, x, y, z, currobj, objList, LevelInfo);
RenderUnitySprite(game, x, y, z, currobj, objList, LevelInfo, 1);
if (currobj.link !=0)
{
fprintf(UNITY_FILE, "\n\tCreateUWScriptObjects(myObj,0,0,\"%s\",\"a_do_trap_platform\",%d);", UniqueObjectName(objList[currobj.link]), currobj.flags);
}
else
{
fprintf(UNITY_FILE, "\n\tCreateUWScriptObjects(myObj,0,0,\"\",\"a_do_trap_platform\",%d);",currobj.flags);
}
break;
//case 24://Bullfrog
//
default:
//RenderEntityParticle(game, x, y, z, currobj, objList, LevelInfo, 0);
RenderUnityModel(game, x, y, z, currobj, objList, LevelInfo);
RenderUnitySprite(game, x, y, z, currobj, objList, LevelInfo, 1);
// fprintf(MAPFILE, "\n// entity %d\n{\n", EntityCount);
// fprintf(MAPFILE, "\"classname\" \"func_static\"\n");
// fprintf(MAPFILE, "\"name\" \"%s\"\n",UniqueObjectName(currobj));
// //models/darkmod/decorative/hourglass.ase
// fprintf(MAPFILE, "\n\"model\" \"models/darkmod/decorative/hourglass.ase\"");
// fprintf(MAPFILE, "\"origin\" \"%f %f %f\"\n", x, y, z);
// fprintf(MAPFILE, "\n}");
// EntityCount++;
}
return;
}
void RenderUnityEntityA_CHANGE_TERRAIN_TRAP(int game, float x, float y, float z, ObjectItem &currobj, ObjectItem objList[1600], tile LevelInfo[64][64])
{
//
//A trigger that converts one type of terrain into another.
//We generate both types of terrain at the start but hide the second type until the trigger is activated.
//render func static for the initial tiles.
//////PrimitiveCount = 0;
//////int tileCount = 0;
RenderUnityModel(game, x, y, z, currobj, objList, LevelInfo);
RenderUnitySprite(game, x, y, z, currobj, objList, LevelInfo, 1);
//////for (int i = 0; i <= currobj.x; i++)
////// {
////// for (int j = 0; j <= currobj.y; j++)
////// {
////// //Then render a func static for how it ends up.
////// PrimitiveCount = 0;
////// fprintf(MAPFILE, "\n// entity %d\n{\n", EntityCount++);
////// fprintf(MAPFILE, "\"classname\" \"%s\"\n", objectMasters[currobj.item_id].path);
////// fprintf(MAPFILE, "\"name\" \"%s_%02d_%02d\"\n", UniqueObjectName(currobj), currobj.tileX + i, currobj.tileY + j);
////// fprintf(MAPFILE, "\"model\" \"%s_%02d_%02d\"\n", UniqueObjectName(currobj), currobj.tileX + i, currobj.tileY + j);
////// fprintf(MAPFILE, "\"origin\" \"%d %d %d\"\n", currobj.tileX*BrushSizeX + (i*BrushSizeX), currobj.tileY*BrushSizeY + (j*BrushSizeY), 0);
////// tile t; //temporary tile for rendering.
////// t.tileType = currobj.quality & 0x01;
////// t.Render = 1;
////// t.floorHeight = ((currobj.zpos >> 3) >> 2) * 8; //heights in uw are shifted
////// t.floorHeight = (currobj.zpos >> 2); //heights in uw are shifted
////// t.ceilingHeight = 0;
////// if (game != UW2)
////// {
////// t.floorTexture = (currobj.quality >> 1) + 210;
////// }
////// else
////// {
////// t.floorTexture = LevelInfo[currobj.tileX][currobj.tileY].floorTexture;//?
////// }
////// t.shockCeilingTexture = LevelInfo[currobj.tileX + i][currobj.tileY + j].shockCeilingTexture;
////// t.wallTexture = LevelInfo[currobj.tileX + i][currobj.tileY + j].wallTexture;
////// t.West = LevelInfo[currobj.tileX + i][currobj.tileY + j].West;
////// t.East = LevelInfo[currobj.tileX + i][currobj.tileY + j].East;
////// t.North = LevelInfo[currobj.tileX + i][currobj.tileY + j].North;
////// t.South = LevelInfo[currobj.tileX + i][currobj.tileY + j].South;
////// t.isWater = 0;
////// t.DimY = 1;
////// t.DimX = 1;
////// t.hasElevator = 0;
////// t.BullFrog = 0;
////// RenderDarkModTile(game, 0, 0, t, 0, 0, 0, 1);
////// fprintf(MAPFILE, "\n}\n");
////// }
////// }
}
void RenderUnityEntityForceField(int game, float x, float y, float z, ObjectItem &currobj, ObjectItem objList[1600], tile LevelInfo[64][64])
{
RenderUnityModel(game, x, y, z, currobj, objList, LevelInfo);
fprintf(UNITY_FILE, "\n\tCreateForceField(myObj);");
}
void RenderUnityEntityMoonGate(int game, float x, float y, float z, ObjectItem &currobj, ObjectItem objList[1600], tile LevelInfo[64][64])
{
RenderUnityModel(game, x, y, z, currobj, objList, LevelInfo);
fprintf(UNITY_FILE, "\n\tCreateMoonGate(myObj);");
UnityRotation(game, 0, currobj.heading, 0);
}
void RenderUnityEntityTMAP(int game, float x, float y, float z, ObjectItem &currobj, ObjectItem objList[1600], tile LevelInfo[64][64])
{//Flat patch objects used as decals. This should be changed into something like a SHOCK screen model?
//params
//link to see if it can be activated
//tileX
//tileY
//index
if (currobj.y == 0)
{
x = (currobj.tileX*BrushSizeX + (BrushSizeX / 2))/100.0;
y=y+0.02;
}
if (currobj.y == 7)
{
x = (currobj.tileX*BrushSizeX + (BrushSizeX / 2)) / 100.0;
y = y - 0.02;
}
if (currobj.x == 0)
{
y = (currobj.tileY*BrushSizeY + (BrushSizeY / 2)) / 100.0;
x = x + 0.02;
}
if (currobj.x == 7)
{
y = (currobj.tileY*BrushSizeX + (BrushSizeY / 2)) / 100.0;
x = x - 0.02;
}
//x=(currobj.tileX*BrushSizeX+(BrushSizeX/2));
//y = (currobj.tileX*BrushSizeX + (BrushSizeX / 2));
// z = (LevelInfo[currobj.tileX][currobj.tileY].floorHeight*BrushSizeZ)/100.0;
RenderUnityModel(game, x, y, z, currobj, objList, LevelInfo);
RenderUnityObjectInteraction(game, x, y, z, currobj, objList, LevelInfo);
//SetScale(0.9375f,0.9375f,0.9375f);
//RenderUnitySprite(game, x, y, z, currobj, objList, LevelInfo, 0);
if (isTrigger(objList[currobj.link]) != 0)
{
//fprintf(UNITY_FILE, "\n\tCreateTMAP(myObj,\"textures/tmap/%s\", \"%s\", %d, false);", textureMasters[currobj.texture].path, UniqueObjectName(objList[currobj.link]), currobj.texture);
fprintf(UNITY_FILE, "\n\tCreateTMAP(myObj,\"%s\", \"%s\", %d, false);", textureMasters[currobj.texture].path, UniqueObjectName(objList[currobj.link]), currobj.texture);
}
else
{
//fprintf(UNITY_FILE, "\n\tCreateTMAP(myObj,\"textures/tmap/%s\", \"\" , %d, false);", textureMasters[currobj.texture].path, currobj.texture);
fprintf(UNITY_FILE, "\n\tCreateTMAP(myObj,\t\"%s\", \"\" , %d, false);", textureMasters[currobj.texture].path, currobj.texture);
}
//textureMasters[currobj.texture].path
if (game != SHOCK)
{
UnityRotation(game, 0, currobj.heading, 0);
}
else
{
UnityRotation(game, currobj.Angle1, currobj.Angle2, currobj.Angle3);
}
if (isTrigger(objList[currobj.link]) != 0)
{
//object is a trigger
//CreateUnityScriptCall(game, x, y, z, currobj, objList, LevelInfo, "ButtonHandler");
}
//else
// {
// }
return;
}
void RenderUnityEntityBOOK(int game, float x, float y, float z, short message, ObjectItem &currobj, ObjectItem objList[1600], tile LevelInfo[64][64])
{
//A book in UW and an audio log/text in Shock. Xdata is generated in advance based on game files.
//Params
//tileX