Aller au contenu

Photo

Ambient_Start problems


19 réponses à ce sujet

#1
Kilrogg_

Kilrogg_
  • Members
  • 296 messages
I'm trying to make a team of creatures change their ambient behavior when the player walks into a trigger. This is my script, but it won't actually compile. I get an 'unknown state in compiler' on the line with Ambient_StartTag.

I am still very new to scripting so I'm probably forgetting something very obvious.


#include "sys_ambient_h"
#include "utility_h"
#include "wrappers_h"
#include "events_h"

void main()
{
    event ev = GetCurrentEvent();
    int nEventType = GetEventType(ev);
    object oPC = GetHero();
    int nEventHandled = FALSE;

    switch(nEventType)
    {

        ////////////////////////////////////////////////////////////////////////
        // Sent by: The engine
        // When: A creature enters the trigger
        ////////////////////////////////////////////////////////////////////////
        case EVENT_TYPE_ENTER:
        {

            Ambient_StartTag(forest_group1, 0, 109, am_grp01_, 0, 0.0f);

            break;
        }


    }
    if (!nEventHandled)
    {
        HandleEvent(ev, RESOURCE_SCRIPT_TRIGGER_CORE);
    }
}

Modifié par Kilrogg_, 29 mai 2010 - 06:57 .


#2
TimelordDC

TimelordDC
  • Members
  • 923 messages
forest_group1 is a string and should be within double-quotes.

#3
Kilrogg_

Kilrogg_
  • Members
  • 296 messages
Yep... damnit :P



Thanks!

#4
DavidSims

DavidSims
  • BioWare Employees
  • 196 messages
One thing to be careful of is this trigger doesn't check who is entering, and it doesn't have a do once on it. Any creature, including all party members, neutrals and hostiles, that passes through it is going to reset the ambient behavior of that creature every time they pass through it.

#5
Kilrogg_

Kilrogg_
  • Members
  • 296 messages
I actually ended up using normal ambient behavior to achieve the desired result without scripting (when I get within 50m of a group of enemies that are around a corner they start running towards their waypoint and effectively run into the PC, which was the goal).



But yeah thanks David I'll keep that in mind.

#6
Craig Graff

Craig Graff
  • Members
  • 608 messages
Just one addition to David's list: placeables entering a trigger via a SetPosition command will also set off the trigger.

#7
Kilrogg_

Kilrogg_
  • Members
  • 296 messages
Got another sort of related problem so I'll post it here instead of making yet another topic.



One of my areas starts with a chase scene where the player is pursuing an NPC. The NPC runs past a group of her buddies, who then run into the player and try to stop him while she keeps running away.



I have this NPC set to run through a group of waypoints as its ambient behavior and it works perfectly, until I get into combat with her buddies. At that point she will stop at the next waypoint (which is still in view of the player) and stand there until I kill everyone, at which point she resumes her ambient behavior.



The pursued NPC is set to Neutral/Non Combatant (I also tried different combinations), I tried putting her in a different team than her buddies and that did not fix it either. It appears ambient behavior (or at least ambient movement) in the vicinity of combat just stops.



Is there a way to keep that NPC's ambient behavior during combat or do I have to script her waypoint movement instead?

#8
DavidSims

DavidSims
  • BioWare Employees
  • 196 messages
You may have to script the waypoint movement. I think the ambient system is designed to shut off during combat. There may be an override for that to apply to individual creatures, but I'm not certain.

#9
Kilrogg_

Kilrogg_
  • Members
  • 296 messages
I'm guessing UT_QuickMove is the way to go here?

#10
Craig Graff

Craig Graff
  • Members
  • 608 messages
UT_QuickMove will likely work for you, but if you need to have a particular creature continue to do their ambient behavior during combat, just set the AMBIENT_SYSTEM_STATE to 19. Note that even this will not work if the creature itself is in combat.

#11
Kilrogg_

Kilrogg_
  • Members
  • 296 messages
Awesome that works great, thanks Craig.



That also fixed another problem I was having with a creature being triggered from inactive to active not starting its ambient behavior on being set to active.

#12
Balmondt

Balmondt
  • Members
  • 32 messages
ok. i'm not sure if this is that much similar to the original post but here's my situation.

i'm trying to make a boss enemy that you have to talk to in order to start a battle with him.

and i was also trying to have him turn into an arcane horror after the convo or after he loses the first battle... i just started using the toolset and was wondering if any of this is possible...

#13
Sonmeister

Sonmeister
  • Members
  • 167 messages
Balmondt

All of this is possible. You can put a conversation on your boss enemy and make him neutral to start. Then you can have him go hostile somewhere in the conversation with a generic call to hostility in the conversation.



You'll have to write a script to make the boss tranform to the arcane horror - but it is all doable from my experience.

#14
Balmondt

Balmondt
  • Members
  • 32 messages
couldn't i just have him sink into the ground and die. then spawn an arcane horror?

and somehow put a bright light in there with it...



can you explain how to do this or link me to some kind of tut on it?

Like i said i just started using the toolset. lol

#15
Balmondt

Balmondt
  • Members
  • 32 messages
ok... i think i'll just have him summon two shades. lol. And his death will summon a pride demon.

any tips on how to do that? ... i think i'll just finish watching some tuts on it. maybe i'll find my answer there.

#16
Balmondt

Balmondt
  • Members
  • 32 messages
Oh... and on a side note. is there any way i could turn the player into an abomination?

the reason i'm asking is because i know there's a cheat in which you can. I wan't to activate it in game. but some how only for a mage. it's a whole fade thing... lol

#17
Balmondt

Balmondt
  • Members
  • 32 messages
And since nobody else will answer me on any other site... i have a problem with my object inspector... it says object inspector but everything else is just gray... there is nothing under it. not even select object. Does anyone know what i should do? because i can't do much without it... Also i kind of messed everything up with the toolbar shortcuts. Any idea on how to get it back to normal.

would i have to reinstall the toolset? I think i just might try that.

#18
BillHoyt

BillHoyt
  • Members
  • 109 messages

Balmondt wrote...

ok... i think i'll just have him summon two shades. lol. And his death will summon a pride demon.
any tips on how to do that?.


If the Boss standing in one place, just put whatever you'd like to appear around him in the level, all set to inactive.  Make sure they are all assigned to the same team (NOT -1, something like 39, that nothing else around has.) On the bad guy's death, kick off UT_TEAMAPPEARS(39) via script. if your critters have starting animations, those will run and your critters will go hostile.

#19
Balmondt

Balmondt
  • Members
  • 32 messages
okay, so i decided to uninstall it from my computer and re-download it. and now i can't get the thing to work... I'm all sorts of frustrated. i think i killed it


#20
Balmondt

Balmondt
  • Members
  • 32 messages
never mind. i got it to work...