Portal-Zone Gothic-Zone Gothic II-Zone Gothic 3-Zone Gothic 4-Zone Modifikationen-Zone Download-Zone Foren-Zone RPG-Zone Almanach-Zone Spirit of Gothic

 

Seite 19 von 31 « Erste ... 8121516171819202122232630 ... Letzte »
Ergebnis 361 bis 380 von 606
  1. Beiträge anzeigen #361 Zitieren
    Veteran
    Registriert seit
    Jan 2012
    Beiträge
    681
     
    Frank-95 ist offline
    How can I get the value of a variable by knowing its name?

    E.g.:

    Code:
    var int foo; foo = 2;
    
    Print(getvalue("foo")); //prints 2

  2. Beiträge anzeigen #362 Zitieren
    Ehrengarde Avatar von mud-freak
    Registriert seit
    Dec 2005
    Beiträge
    2.199
     
    mud-freak ist offline
    Zitat Zitat von Frank-95 Beitrag anzeigen
    How can I get the value of a variable by knowing its name?
    Check out Ikarus_Doc.d at line 960.

  3. Beiträge anzeigen #363 Zitieren
    Veteran
    Registriert seit
    Jan 2012
    Beiträge
    681
     
    Frank-95 ist offline
    Thanks!

  4. Beiträge anzeigen #364 Zitieren
    Adventurer
    Registriert seit
    Sep 2013
    Beiträge
    66
     
    Vic7im ist offline
    Is there a quicker function that checks if a certain variable is inside a numeral range, for example to check if a player's combat skill is between 30 and 60?

  5. Beiträge anzeigen #365 Zitieren
    Ehrengarde Avatar von mud-freak
    Registriert seit
    Dec 2005
    Beiträge
    2.199
     
    mud-freak ist offline
    Zitat Zitat von Vic7im Beitrag anzeigen
    Is there a quicker function that checks if a certain variable is inside a numeral range, for example to check if a player's combat skill is between 30 and 60?
    I don't think there is a much "quicker" way than this (separate if-conditions).
    Code:
    if (x > 30) {
        if (x < 60) {
            return TRUE;
        };
    };
    return FALSE;

  6. Beiträge anzeigen #366 Zitieren
    Dea
    Registriert seit
    Jul 2007
    Beiträge
    10.447
     
    Lehona ist offline
    I'd assume that quick refers to "quick to type", because the difference in speed will most likely be negligible.
    Anyway, I don't think there's a shortcut, but that sounds like a great addition to the scriptbin.

  7. Beiträge anzeigen #367 Zitieren
    Local Hero
    Registriert seit
    Feb 2013
    Beiträge
    236
     
    pawbuj ist offline
    can I simply add conditionFunc to all chests by ikarus?

  8. Beiträge anzeigen #368 Zitieren
    Dea
    Registriert seit
    Jul 2007
    Beiträge
    10.447
     
    Lehona ist offline
    Yes.

    Code:
    // Call this
    List_ForFS(MEM_World.voblist, addConditionFuncToChests);
    
    func void addConditionFuncToChests(var int node) {
        var zCListSort list; list = _^(node);
        var int ptr; ptr = list.data; // Ikarus says this is of type zCVob but that's just a typo
    
        if (Hlp_Is_oCMobContainer(ptr)) {
            var oCMobContainer chest; chest = _^(ptr);
            chest._oCMobInter_conditionFunc = "MYCONDITIONFUNC"; // You probably need to use all caps
        };
    };
    Edit: If you can't use lego you'll have to loop through the list by yourself, but that isn't hard.

  9. Beiträge anzeigen #369 Zitieren
    Local Hero
    Registriert seit
    Feb 2013
    Beiträge
    236
     
    pawbuj ist offline
    thanks for that.

    conditionFunc will be added to all kind of chests. The problem is that some chests need a key (not a picklock!) to be opened.

    can u help to seperate those 2 groups?

    chests with key can be opened with defined "usewithItem" with non-defined picklockstring. .

  10. Beiträge anzeigen #370 Zitieren
    Dea
    Registriert seit
    Jul 2007
    Beiträge
    10.447
     
    Lehona ist offline
    I don't understand your question.

    You can check chest._oCMobInter_useWithItem for the useWithItem-attribute and chest._oCMobLockable_keyInstance for a required key that will still allow lockpicking (both are strings).

  11. Beiträge anzeigen #371 Zitieren
    Local Hero
    Registriert seit
    Feb 2013
    Beiträge
    236
     
    pawbuj ist offline

    Thumbs up

    Zitat Zitat von Lehona Beitrag anzeigen
    I don't understand your question.

    You can check chest._oCMobInter_useWithItem for the useWithItem-attribute and chest._oCMobLockable_keyInstance for a required key that will still allow lockpicking (both are strings).
    this is I was meaning, thank u!

  12. Beiträge anzeigen #372 Zitieren
    Waldläufer Avatar von Siemekk
    Registriert seit
    May 2016
    Beiträge
    121
     
    Siemekk ist offline
    I have a little problem with EventManager script. Code:
    Code:
    func void QS_DrawSpell()
    {
    
        const int oCMsgWeapon__sizeof = 80;
            const int oCMsgWeapon__oCMsgWeapon = 7759824;
            const int zCEventManager__OnMessage  = 6283728;
    
            var int oCMsgWeaponPtr; oCMsgWeaponPtr = MEM_Alloc(oCMsgWeapon__sizeof);
        CALL_PtrParam(0);
        CALL_PtrParam(7);
        CALL_PtrParam(0);
        CALL__thiscall(oCMsgWeaponPtr, oCMsgWeapon__oCMsgWeapon);
    
    
        var int EM; EM = MEMINT_VobGetEM(_@(hero));
        if(EM)
        {
            CALL_PtrParam(_@(hero));
            CALL_PtrParam(oCMsgWeaponPtr); 
            CALL__thiscall(EM, zCEventManager__OnMessage);
            Print("DZIAŁAJ!");
        };
        
        MEM_Free(oCMsgWeaponPtr);
    Script don't have crash, but don't work. I don't know where i made a mistake (I first time use MEM_Alloc) sizeof is good, i have print, but hero don't draw rune (AI_ReadySpell is for QuickBar). And my question - where i made a mistake? In C++ code work!
    Code:
        player->GetEM(FALSE)->OnMessage(new oCMsgWeapon(oCMsgWeapon::EV_DRAWWEAPON, 7, 0), player);
    Regards Siemekk.

  13. Beiträge anzeigen #373 Zitieren
    Neuling
    Registriert seit
    Jun 2017
    Beiträge
    7
     
    Varus91 ist offline
    mal eine Frage zur Wettercontrolle

    Der Command

    Code:
    StartRain_Time (6,37,11,22);
    Wo muss der hin? Ich fange gerade erst mit Ikarus an :P

  14. Beiträge anzeigen #374 Zitieren
    Local Hero
    Registriert seit
    Feb 2013
    Beiträge
    236
     
    pawbuj ist offline

    b_loentry

    is there any chance to check first topic loentry.

    I want to add the name of quest when first time activated,

  15. Beiträge anzeigen #375 Zitieren
    Knight
    Registriert seit
    Aug 2009
    Ort
    Hessen
    Beiträge
    1.487
     
    Cryp18Struct ist offline
    Zitat Zitat von pawbuj Beitrag anzeigen
    is there any chance to check first topic loentry.

    I want to add the name of quest when first time activated,
    I'm not sure what you are asking for.
    If you want to display the name of a quest when B_LogEntry is called you could change it like this.
    Code:
    func void B_LogEntry_Detailed (var string topic, var string entry)
    {
    	Log_AddEntry(topic, entry);
    	var string text;
    	text = ConcatStrings (PRINT_NewLogEntry, ": ");
    	text = ConcatStrings (text, topic);
    	PrintScreen(text, -1, YPOS_LOGENTRY, FONT_ScreenSmall, 2);
    	Snd_Play("LogEntry");
    };
    If you want to have different Log Entries depending on how the Quest was started you could try something like this:
    Spoiler:(zum lesen bitte Text markieren)
    Code:
    var int MIS_FindQuestItem;
    var int useAlternateTitleForFindQuestItemQuest;
    const string TOPIC_FindQuestItem = "Retrieve quest item for Friendly Guy";
    const string TOPIC_FindQuestItem_Alternate = "Quest item found on Bandits";
    
    func void findQuestItem(){
    	if(MIS_FindQuestItem == LOG_RUNNING){ // Player already talked to Friendly Guy
    		B_LogEntry_Detailed (TOPIC_FindQuestItem, "I found his quest item.");
    	}else{
    		useAlternateTitleForFindQuestItemQuest = true;
    		Log_CreateTopic (TOPIC_FindQuestItem_Alternate, LOG_MISSION);
    		Log_SetTopicStatus(TOPIC_FindQuestItem_Alternate, LOG_RUNNING);
    		B_LogEntry_Detailed (TOPIC_FindQuestItem_Alternate, "I found a strange quest item on some bandits. I wonder who was the original owner?");
    	};
    	CreateInvItems	(hero, ItMi_QuestItem, 1);
    };
    
    INSTANCE DIA_None_123_FriendlyGuy_StartQuestDia (C_Info)
    {
        npc         = None_123_FriendlyGuy;
        nr          = 2;
        condition   = DIA_None_123_FriendlyGuy_StartQuestDia_condition;
        information = DIA_None_123_FriendlyGuy_StartQuestDia_info;
        permanent   = FALSE;
        important   = FALSE;
        description = "Can I help you?";
    };
    FUNC INT DIA_None_123_FriendlyGuy_StartQuestDia_condition (){
    	return TRUE; 
    };
    FUNC VOID DIA_None_123_FriendlyGuy_StartQuestDia_info ()
    {
        AI_Output(other, self, "DIA_None_123_FriendlyGuy_StartQuestDia_15_0"); //Can i help you?
        AI_Output(self, other, "DIA_None_123_FriendlyGuy_StartQuestDia_15_1"); //Yes! Recover my lost quest item for me.
        AI_Output(self, other, "DIA_None_123_FriendlyGuy_StartQuestDia_15_2"); //Bandits took it and they are hiding in a cave north of here.
    	
        MIS_FindQuestItem = LOG_RUNNING;
    	
        if(!useAlternateTitleForFindQuestItemQuest){ // Player did not find quest item first
            Log_CreateTopic (TOPIC_FindQuestItem, LOG_MISSION);  
            Log_SetTopicStatus(TOPIC_FindQuestItem, LOG_RUNNING); 
            B_LogEntry_Detailed (TOPIC_FindQuestItem, "Friendly Guys quest item was stolen by some bandits. He sent me to recover it.");
        }else{
            B_LogEntry_Detailed (TOPIC_FindQuestItem_Alternate,"Turns out that quest item belongs to Friendly Guy. Some bandits stole it from him. He wants to have it back.");
        };
    };
    
    INSTANCE DIA_None_123_FriendlyGuy_FinishQuestDia (C_Info)
    {
        npc         = None_123_FriendlyGuy;
        nr          = 2;
        condition   = DIA_None_123_FriendlyGuy_FinishQuestDia_condition;
        information = DIA_None_123_FriendlyGuy_FinishQuestDia_info;
        permanent   = FALSE;
        important   = FALSE;
        description = "Here is your quest item.";
    };
    FUNC INT DIA_None_123_FriendlyGuy_FinishQuestDia_condition (){
        if(MIS_FindQuestItem == LOG_RUNNING){
            if(Npc_HasItems(hero, ItMi_QuestItem) > 0){
                return TRUE;
            };
        };
    };
    FUNC VOID DIA_None_123_FriendlyGuy_FinishQuestDia_info ()
    {
        AI_Output(other, self, "DIA_None_123_FriendlyGuy_FinishQuestDia_15_0"); //Here is your quest item.
        B_GiveInvItems(other, self, ItMi_QuestItem, 1);
        AI_Output(self, other, "DIA_None_123_FriendlyGuy_FinishQuestDia_15_1"); //Thank you!
    
    	
        if(!useAlternateTitleForFindQuestItemQuest){ // Player did not find FindQuestItem first
            B_LogEntry_Detailed (TOPIC_FindQuestItem, "Friendly Guy thanked me for returning his quest item.");
            Log_SetTopicStatus(TOPIC_FindQuestItem, LOG_SUCCESS);
        }else{
            B_LogEntry_Detailed (TOPIC_FindQuestItem_Alternate, "Friendly Guy thanked me for returning his quest item.");
            Log_SetTopicStatus(TOPIC_FindQuestItem_Alternate, LOG_SUCCESS);
        };
    	
        MIS_FindQuestItem = LOG_SUCCESS;
    };

  16. Beiträge anzeigen #376 Zitieren
    Local Hero
    Registriert seit
    Feb 2013
    Beiträge
    236
     
    pawbuj ist offline
    I want to add printscreen with (new quest ("topic") only once with first logentry to that quest.

    if u played in german mod "From Thief's Life" you will know what I meant.

    thanks anyway.

  17. Beiträge anzeigen #377 Zitieren
    Waldläufer Avatar von Siemekk
    Registriert seit
    May 2016
    Beiträge
    121
     
    Siemekk ist offline
    I have question about stacktrace.
    Code:
    [f] 01:18 Fault: 0 Q:     [start of stacktrace]
    [f] 01:18 Fault: 0 Q:             CMUSIC_GETTHEME()                                              +   48 bytes
    [f] 01:18 Fault: 0 Q:             CMUSIC_GETWORLDTHEME()                                         +    5 bytes
    [f] 01:18 Fault: 0 Q:             CMUSIC_SETTHEME()                                              +   32 bytes
    [f] 01:18 Fault: 0 Q:             CMUSIC_CALLBACK()                                              +  107 bytes
    [f] 01:18 Fault: 0 Q:             FRAMEFUNCTIONS(13)                                             +  104 bytes
    [f] 01:18 Fault: 0 Q:             FOREACHHNDL(9080, FRAMEFUNCTIONS)                              +  263 bytes
    [f] 01:18 Fault: 0 Q:             [UNKNOWN]                                                      +100921181 bytes
    [f] 01:18 Fault: 0 Q:             _FF_HOOK()                                                     +   32 bytes
    [f] 01:18 Fault: 0 Q:             MEM_CALLBYID(42266)                                            +  224 bytes
    [f] 01:18 Fault: 0 Q:             _HOOK(657075688, 582852560, 0, 451732680, 20313484, 5289, 364643529, 572710616, 5289) +  498 bytes
    [f] 01:18 Fault: 0 Q:             [UNKNOWN]                                                      +95887051 bytes
    [f] 01:18 Fault: 0 Q:     [end of stacktrace]
    [f] 01:18 Fault: 0 Q:     Exception handler was invoked. Ikarus tried to print a Daedalus-Stacktrace to zSpy. Gothic will now crash and probably give you a stacktrace of its own.
    I have this crash (look up), but i don't know what's function create crash - last function is CMUSIC_GETTHEME(), but this functions have debbugers:

    Code:
    func string CMusic_GetTheme()
    {
    	var string zone; 
    	var int vob;
    	vob = MEM_ReadInt(10111524); //oCZoneMusic::CurrentZone
    	
    	if(vob)
    	{	
    		zone =  MEM_ReadString(vob + 16);
    	}
    	else 
    	{
    		return "";
    	};
    	
    	if(STR_Len(zone) > 3)
    	{
    		var string res; res = STR_SubStr(zone, STR_Len(zone) - 3, STR_Len(zone));
    		
    		if(STR_Len(res) > 0){
    			return res;
    		};	
    	};
    	return "";
    };
    So, it's my fault? 100% yes, but where i made mistake, code look's good...

  18. Beiträge anzeigen #378 Zitieren
    Apprentice Avatar von Rayzer
    Registriert seit
    Sep 2014
    Ort
    Poland
    Beiträge
    44
     
    Rayzer ist offline
    Does ZenGin has function that converts vector 3D to vector 2D? I mean world position to screen position. Just like focused NPC name.

  19. Beiträge anzeigen #379 Zitieren
    Local Hero
    Registriert seit
    Feb 2013
    Beiträge
    236
     
    pawbuj ist offline
    hi all,

    can I modify the choice box dimension? in gothic 1 the longest dialog options are partly cutted.

  20. Beiträge anzeigen #380 Zitieren
    Local Hero
    Registriert seit
    Feb 2013
    Beiträge
    236
     
    pawbuj ist offline
    Hi, anyone knows how to change value of item during the game?

Seite 19 von 31 « Erste ... 8121516171819202122232630 ... Letzte »

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • Anhänge hochladen: Nein
  • Beiträge bearbeiten: Nein
Impressum | Link Us | intern
World of Gothic © by World of Gothic Team
Gothic, Gothic 2 & Gothic 3 are © by Piranha Bytes & Egmont Interactive & JoWooD Productions AG, all rights reserved worldwide