Most asked questions |
Top Previous Next |
Q: I would like to have a looping sound attached to one of the robot-scripts. How can this be done? A: Here's the code for the modified robot2 action; the new lines of code are red.
sound patrol_wav = <patrol.wav>;
ACTION robot2 { ent_playloop (my, patrol_wav, 200); MY._FORCE = 2; MY._FIREMODE = DAMAGE_SHOOT+FIRE_PARTICLE+HIT_FLASH+0.05; MY._HITMODE = HIT_GIB;//HIT_EXPLO; MY._WALKSOUND = _SOUND_ROBOT; anim_init(); drop_shadow(); // attach shadow to robot actor_fight(); // if(MY.FLAG4 == ON) { patrol(); } // create(<arrow.pcx>,MY.POS,_ROBOT_TEST_WATCHER); // used to activate watcher drone }
Q: How could I implement a panel that will fade in and out depending on the player's pan angle? The panel would simulate a fullscreen flare effect. A: Use the code below.
bmap flarepan_tga = <flarepan.tga>;
panel flare_pan { pos_x = 0; pos_y = 0; bmap = flarepan_tga; flags = overlay, refresh, transparent, visible; }
starter show_flare() { while (player == null) {wait (1);} while (1) { if (player.pan < 180) { temp.x = 360 - player.pan; } else { temp.x = player.pan; } player.pan %= 360; flare_pan.alpha = temp.x * temp.x / 1500; // play with "1500" wait (1); } }
Q: I was able to associate the problem I'm having with a .sav file that is created when I run my project. When I delete it, everything works ok. Is there anything I can do to turn this thing off? A: Open menu.wdl and add a line of code to function save_status()
function save_status() { return; ifdef old_a52; save_info(INFO_NAME,0); ifelse; game_save(app_name,0,SV_INFO+SV_STRINGS+SV_BMAPS); endif; }
Q: Is there anything that would cut off the display of a text object? I mean out of nowhere, it just stops displaying the string even though there is plenty of room left to display it? A: This was a bug in one of the early A6 versions. Download the new update and the problem will disappear.
Q: How can you create a panel that only appears under certain conditions? For example a special panel coming up when you reach full health. A: Use the code below:
bmap full_pcx = <fullhealth.pcx>;
panel full_pan { pos_x = 0; pos_y = 0; bmap = full_pcx; flags = overlay, refresh; }
starter show_panel() { while (player == null) {wait (1);} while (1) { if (player._health == 100) { full_pan.visible = on; } else { full_pan.visible = off; } wait (1); } }
Q: I was wondering if there was any way to have my character smoothly go from the final frames of the walk cycle into the first frames of the standing cycle. A: Use the code sample below:
.................................................
while(my.skill20 < 100) { ent_cycle("walk", my.skill20); ent_blend("stand", 0, my.skill20); my.skill20 += 10 * time; wait(1); }
................................................
Q: Any tips on how to make my game panels have the same size on all resolutions? A: This feature is available only in the A6 beta version at the moment. Take a look at the code below to see how it works.
bmap ammo_pcx = <ammo.pcx>;
panel ammo_pan { pos_x = 0; pos_y = 0; bmap = ammo_pcx; flags = overlay, refresh, visible; }
starter adjust_panel() { while (1) { if (video_mode == 6) // 640 x 480 pixels? { ammo_pan.scale_x = 1; ammo_pan.scale_y = 1; } if (video_mode == 7) // 800 x 600 pixels? { ammo_pan.scale_x = 800 / 640; ammo_pan.scale_y = 600 / 480; } if (video_mode == 8) // 1024 x 768 pixels? { ammo_pan.scale_x = 1024 / 640; ammo_pan.scale_y = 768 / 480; } wait (1); } }
Q: I'm wondering what I would do to change the camera from the path it's on to the normal 1st person view. A: Use two different views: camera and second_camera. Define and use second_camera for the path and then use the camera for the 1st person view.
function main() { .................... camera.visible = off; second_camera.visible = on; // show second_camera on the path }
function switch_cameras() { second_camera.visible = off; camera.visible = on; // show the 1st person view }
on_s = switch_cameras;
|