dim3 Forum

Full Version: /Engine|Questions\
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi, I'm working on a project (can't say nuthin yet) and in it I plan to do this:

The player can pause everything around him and switch weapons. He can still switch weapons/use armor but he can't fire or do anything else. That possible?

By the way, just to confirm this, you can apply armor right? So if you walked over an armor lying on teh ground it would add it to your "weapons" list and you could select it and apply it.

...

Wait a minute, while typing that out I thought (wow!) of something: Couldn't it be a weapon but actually apply negative damage on me that would last for a certain amount of time?

Could the player select a gun and click a button to switch the ammo? "This" ammo does "this" much damage while "this" ammo does "this" much damage. And switch gun icon so the player could tell?

So basically, player can stop time and apply armor/equip weapon and switch ammo.
Thank you. Smile
I don't think you'd have the armor be a weapon, at least not in the conventional sense; better to script a pickup and have it as a power-up; I imagine you could script it in a similar fashion to the Grenade weapon.


As for the ammo, I am certain that would be relatively easy to do; just script an event that when you press a certain key it might toggle a weapons alt-fire (you can have multiple ones I believe); perhaps set a variable so that the game knows which ammo you are equipped with, and then fire the appropriate projectile as well as toggle the appropriate icon; it would then be a matter of scripting the damage for the different projectiles as you see fit....
To pause everything, get the count of objects from the course script and use a for loop to send messages telling all of them to stop. I think that might work.
Code:
    for (i=0;i!=cnt;i++) {
        name=map.spot.getName(i);
        type=map.spot.getType(i);
        if ((type=='Object') || (type=='Bot')) {
            map.spot.attachObject(i,name,type,map.spot.getScript(i),map.spot.getParameter(i));
        }
    }
}
This code is in the course script and can be modified to get the number of objects and stuff.
What about still being able to switch weapons/activate armor/switch ammo while everything is paused?
Well, all your doing is pausing the enemies. You can still move so you'll have to script the player to not move or fire. If you can do that, it should work.
Reference URL's