Aller au contenu

Photo

Help with my script for my adventure


  • Veuillez vous connecter pour répondre
2 réponses à ce sujet

#1
Creed13

Creed13
  • Members
  • 2 messages
 Hello all, i'm trying to make something to learn this toolset, so today i start working with it. 

As a start i wanted to make a mini-adventure where u are a normal warrior that has been called from his lady to make a new army for her, cause the last one was almost defeated.

So here's my problem i can't make that when i finish the quest a soldier summon near me, maybe someone can help me? (i've made a waypoint tag= summon and the soldier that as tag=soldier). Maybe someone can give me advice on how to make it happen? :D

#include "events_h"

#include "global_objects_h"
void main() {
event ev = GetCurrentEvent();
int nEventType = GetEventType(ev); //extract event type from current event
int nEventHandled = FALSE; //keep track of whether the event has been handled
object npc = GetObjectByTag("soldier");
int type = GetObjectType(npc);
location ltarget = GetLocalLocation(OBJECT_SELF,"summon");
resource res = GetLocalResource(OBJECT_SELF,"soldier.utc");
switch(nEventType)
{
case EVENT_TYPE_PARTY_MEMBER_FIRED:
{
CreateObject(type,res,ltarget);
break;
}
}
if (!nEventHandled) //If this event wasn't handled by this script, let the
{
HandleEvent(ev, RESOURCE_SCRIPT_MODULE_CORE);
}

}

Just post if u need more information ^^ 

Modifié par Creed13, 13 novembre 2009 - 07:59 .


#2
Shade Sharphook

Shade Sharphook
  • Members
  • 60 messages
try/change these lines:

location ltarget = GetLocation(GetObjectByTag("summon"));
resource res = R"soldier.utc";
CreateObject(OBJECT_TYPE_CREATURE, res ltarget);


You may need to change "soldier.utc" to be what ever your resource name is, rather than what the current tag is, if you want to create one that is not in the area.
If you want to use an existing soldier in the area, there are commands like SetLocation that may be useful to move it around.

Modifié par Shade Sharphook, 14 novembre 2009 - 04:04 .


#3
Creed13

Creed13
  • Members
  • 2 messages
I think ur line are a lot better than mine, but it sill don't work, maybe is because i put a wrong CASE option? Cause i tried to put when i fire my ally , when i end the plot but it still don't want to show him >.<



Someone know a way to make this solderi appear in that place? >.<