Aller au contenu

Photo

Compling error


  • Veuillez vous connecter pour répondre
1 réponse à ce sujet

#1
smjones23

smjones23
  • Members
  • 42 messages
Trying to skip character generation and assign creature as player

#include "sys_chargen_h"

#include "utility_h"



case EVENT_TYPE_MODULE_START:

{

// skip character generation

object oHero = GetHero();

Chargen_InitializeCharacter(oHero);

Chargen_SelectRace(oHero,RACE_HUMAN);

Chargen_SelectCoreclass(oHero,class_WARRIOR);

Chargen_SelectBackground(oHero,BACKGROUND_NOBLE);



LoadItemsFromTemplate(oHero, "main_character.utc", TRUE);



break;

}







When I did this I got an error about invalid declaraction type. I didn't have the void main () in there. Neither did the wiki though, I just noticed it was in just about every script. I put it in there and now the error has changed.

It says unknown state in compiler. When I double click it takes me to line five which is this:

case EVENT_TYPE_MODULE_START

#2
FollowTheGourd

FollowTheGourd
  • Members
  • 572 messages
Is what you posted there your complete script? If so, it'll pay off in the long run to learn about it instead of relying on scripts posted on the wiki or elsewhere. Maybe somebody can just post a whole script for you, but I wouldn't want to just blindly do that without better knowing what I'm doing in the game.

The wiki might not have provided a complete script, but just a fragment with the intent that somebody would know how to use it in a whole script. Edit: to get you started, you'll need the "void main" (unless it's a header or a conditional, but I don't think that would be the case here) and case statements go inside a switch-statement. That's at least two things preventing the script from compiling.

I don't know of any resources for DAScript (admittedly I haven't really looked on the wiki for a tutorial - there's stuff there, but just not really in any grounds-up sort of way), but there should at least be some resources available for NWScript, and you could also find a C tutorial to better understand some of the syntax (you don't need to learn the more advanced stuff in C like pointers, or even that much at all).

NWScript isn't exactly the same as DAScript, but if you're familiar with it then DAScript should look pretty familiar - just a lot of the functions you call are different. I only mention it since it probably has more resources on it right now - just keep in mind some fundamental things have changed in Dragon Age's scripting language.

Modifié par FollowTheGourd, 11 novembre 2009 - 06:31 .