• 0

    posted a message on Follow Unit Smoothly

    The unit movement is COMPLETELY SMOOTH when using an actor instead of the unit itself. Currently, I can create an actor using:

    unitgroup group = UnitCreate(1, "Carrier", c_unitCreateIgnorePlacement, 1, Point(50, 50), 0);
    unit ship = UnitGroupUnit(group, 1);

    actorscope as = ActorScopeFromUnit(ship);
    actor act = ActorFromScope(as, "::Main");

    Looking at TriggerLibs/NativeLib, I have figured out how to move the actor and do all kinds of other cool stuff. The only problem is that I have to create a new unit for every such actor... I would prefer to just create the actor itself. There is a function in NativeLib that seems to do just that:

    actor libNtve_gf_CreateModelAtPoint (string lp_model, point lp_position) {
        // Variable Declarations
        actor lv_a;

        // Variable Initialization
        lv_a = null;

        // Implementation
        ActorCreate(null, "Model", (lp_model), null, "null");
        lv_a = libNtve_gf_LastCreatedActor();
        ActorSend(lv_a, libNtve_gf_ActorMsg1("SetPositionH", libNtve_gf_ConvertXYToString(PointGetX(lp_position), PointGetY(lp_position))));
        ActorSend(lv_a, libNtve_gf_SetHeight(PointGetHeight(lp_position)));
        return lv_a;
    }

    Unfortunately it doesn't do anything for me. I just can't seem to pass the right lp_model string. I've tried almost everything. Most of the time it just does nothing, but if you give it something ending in ".m3", such as "Assets\Units\Zerg\Mutalisk\Mutalisk.m3", the trigger crashes with an "unable to create actor" error. Perhaps I'm on the right track... any ideas?

    Posted in: Galaxy Scripting
  • 0

    posted a message on Follow Unit Smoothly

    Does anyone know of a good way to follow a unit smoothly with the camera? Currently, I have a loop that updates the unit and camera position 16 times per second. This works fine when the unit is moving slowly, but sucks when the unit has a higher velocity. Setting blend = true makes it somewhat better, but it's still not great. The problem I think may be because the unit and camera do not move together: first the unit gets moved, and for a moment the unit is off-center, and then the camera moves back in place.

    I think maybe actors might offer a solution, as the (very sparse) Blizzard documentation says that they are asynchronous... so that they will not move before the camera is moved. Unfortunately, I'm not sure how to make actors that appear onscreen from Galaxy script. I can create my own actor model using ActorCreate, but it does not appear anywhere. I can get an actor from a unit, and move that around, but it suffers from the same problems as before (probably because the actor is still tied to the unit, and is thus synchronous). Any ideas?

    PS: I've tried using CameraFollowUnitGroup, but my unit is moving too fast, and it just drifts off-center :(

    Posted in: Galaxy Scripting
  • 0

    posted a message on What to change in the Galaxy Editor
    Quote from RileyStarcraft: Go

    @XPilot: Go

    There are no mousex/mousey functions due to the network architecture. The server can't know the mouse position of the client without asking for it and due to network latency the mouse position is likely very different by the time the trigger runs to when the client sees the response.

    The basic issue is the lack of a "client-side" trigger which is not synced across the network. That would be a non-trivial addition to the engine though and would probably be massively complicated as there would be a very strict set of rules as to what could and couldn't be done in such triggers, and you'd need to marshal data (local vs. synced), etc. So it's not going to happen.

    However, making it so the client sends the mouse cursor position when certain other events occur - like keypresses - is entirely possible and hopefully is added.

    That is ridiculous. SC2 already collects mouse data for various things. Just take CameraForceMouseRelative as an example... this makes it so that the camera motion is inherently linked to mouse motion. The EXACT same thing could be done, except instead of moving the camera upon mouse motion, the game could fire some trigger and update some mouse position values. Blizzard is just being really lame by not including this...

    Posted in: Galaxy Editor Bugs and Feedback
  • 0

    posted a message on What to change in the Galaxy Editor

    Well this article pretty much sums up everything wrong with the Galaxy language: http://www.sc2mod.com/board/index.php?page=Thread&threadID=77

    Also, please have MouseGetX/MouseGetY functions, I don't want to have to create another program that runs behind SC2 that just clicks the mouse for me...

    Posted in: Galaxy Editor Bugs and Feedback
  • 0

    posted a message on Me looking for good team (scripter)

    @Madlios: Go

    Sure, I'd be interested, although you're probably already aware of that ;) Why didn't you also ask over at sc2mod?

    Posted in: Team Recruitment
  • 0

    posted a message on [WIP] 2D/3D Sprite RPG

    How did you implement sprites? I am making a game that would really need some good old 2D sprites.

    Posted in: Project Workplace
  • 0

    posted a message on [Trigger] Writing code in pure Galaxy

    Thanks MotiveMe, now I can finally start coding maps!

    Posted in: Tutorials
  • 0

    posted a message on No mouse move event? impossible to do top down shooter?

    While I suppose this works for a top-down shooter, I need to access the mouse's actual position (or relative movements). What I plan to do is have a ship turn clockwise when the mouse turns right and vice-versa, while keeping the camera centered on the ship. Is there any way to do this?

    Posted in: Galaxy Scripting
  • To post a comment, please or register a new account.