Getting the name of a map? and other frustrating stuff

Talk about any Deus Ex game modification here, e.g. maps, package or a total conversion.

Moderator: Forum Guards

Getting the name of a map? and other frustrating stuff

Postby Ayleth » Tue Apr 24, 07 7:23 pm

should this work for getting the name of a map thats currently loaded on the server?

Code: Select all
 foreach allactors(class'DeusExLevelInfo',info)
        MapName=Info.MapName;


apparently its not working for me :(

Also, i want some fars, vectors, to show up in Advanced options.
i have this in the .int:
Code: Select all
Preferences=(Caption="Portal Settings",Parent="Advanced Options",Class=Portalv1.PortalController,Immediate=True)

and some of the vars show up well but there are others, related to a portal spawner that im making, that all read zeroed out. heres the code for the controller:

Code: Select all
class PortalController extends actor config (Portal);

var config bool bLimitedPortalNumbers;
var config int MaxPortals;
var config bool bAllowSummon;
var config bool bMakeSound;

struct MapOne
{
    var config vector portalLocations[20];
    var config String MapName;
};
var config MapOne Map1;

struct MapTwo
{
    var config vector portalLocations[20];
    var config String MapName;
};
var config MapTwo Map2;

struct MapThree
{
    var config vector portalLocations[20];
    var config String MapName;
};
var config MapThree Map3;

struct MapFour
{
    var config vector portalLocations[20];
    var config String MapName;
};
var config MapFour Map4;

struct MapFive
{
    var config vector portalLocations[20];
    var config String MapName;
};
var config MapFive Map5;


The Struct formation appears no problem, but theres no info even when the .ini has the settings in it.
Sorry for the length.

ALSO...
i have serveractors=Portalv1.PortalSpawner in my DX.ini but this actor doesn't get spawned in the game? if i do killall for the spawner, says its not even on the server, and if i summon it ingame, then it works fine??
¨‘°ºMåsåmµñ£º°‘¨
˙•●●ĊђασsΪηcǻяйαѓε●●•˙
jason.unger@gmail.com
User avatar
Ayleth
Regular
 
Posts: 313
Joined: Sun Jul 09, 06 7:27 pm
Location: 6 feet under. and trying to get out!

Postby Dae » Tue Apr 24, 07 8:10 pm

Maybe this would answer your question about a map name?

serveractors=Portalv1.PortalSpawner

What kind of actor is that? Paste some pieces of code (definition, postbeginplay).
User avatar
Dae
Alpha
 
Posts: 12086
Joined: Sat Sep 06, 03 4:40 pm

Postby Ayleth » Tue Apr 24, 07 8:36 pm

hmmm, you just made me think i need to use postbeginplay, im using pre atm.

Code: Select all
class PortalSpawner extends Actor config (portal);


ugh... ilike i said, im using pre. needs to be post? the thing is it seems like its not even getting spawned. killall returns none.

Code: Select all
function prebeginplay()
{
    local int i;
    local int m;
    local string MapName;
    local DeusExLevelInfo info;
    SummonController();
    foreach allactors(class'DeusExLevelInfo',info)
        MapName=Info.MapName;

    if (MapName==Controller.Map1.MapName)
        {
            for (i=0;i<10;i++)
            {
                if (controller.Map1.portalLocations[i]!=vect(0,0,0))
                    spawn(class'portal',self,,controller.Map1.PortalLocations[i]);
            }
        }
    else if (MapName==Controller.Map2.MapName)
        {
            for (i=0;i<10;i++)
            {
                if (controller.Map2.portalLocations[i]!=vect(0,0,0))
                    spawn(class'portal',self,,controller.Map2.PortalLocations[i]);
            }
        }

    else if (MapName==Controller.Map3.MapName)
        {
            for (i=0;i<10;i++)
            {
                if (controller.Map3.portalLocations[i]!=vect(0,0,0))
                    spawn(class'portal',self,,controller.Map3.PortalLocations[i]);
            }
        }

    else if (MapName==Controller.Map4.MapName)
        {
            for (i=0;i<10;i++)
            {
                if (controller.Map4.portalLocations[i]!=vect(0,0,0))
                    {
                    spawn(class'portal',self,,controller.Map4.PortalLocations[i]);
                    break;
                    }
            }
        }
    else if (MapName==Controller.Map5.MapName)
        {
            for (i=0;i<10;i++)
            {
                if (controller.Map5.portalLocations[i]!=vect(0,0,0))
                    spawn(class'portal',self,,controller.Map5.PortalLocations[i]);
            }
        }
}


btw thanks for the link, will check that out.
¨‘°ºMåsåmµñ£º°‘¨
˙•●●ĊђασsΪηcǻяйαѓε●●•˙
jason.unger@gmail.com
User avatar
Ayleth
Regular
 
Posts: 313
Joined: Sun Jul 09, 06 7:27 pm
Location: 6 feet under. and trying to get out!

Postby Ayleth » Tue Apr 24, 07 9:20 pm

hmmm the info in that link didn't work... sorry. Well atlantis is sending me a bit of code that he recieved... i'll see how that works

EDIT: ahh yes, ok heres the code that Atlantis found in a patch for his SG map provided by nobody:

Code: Select all
left(string(level),instr(string(level),"."))

This will return the string of the current map. i did not realise the level var returned the mapname :S :oops:

OK, so what about the var not appearing problem? Ive never had this.
¨‘°ºMåsåmµñ£º°‘¨
˙•●●ĊђασsΪηcǻяйαѓε●●•˙
jason.unger@gmail.com
User avatar
Ayleth
Regular
 
Posts: 313
Joined: Sun Jul 09, 06 7:27 pm
Location: 6 feet under. and trying to get out!

Postby Dae » Wed Apr 25, 07 7:08 am

Did you try with PostBeginPlay?
User avatar
Dae
Alpha
 
Posts: 12086
Joined: Sat Sep 06, 03 4:40 pm

Postby Ayleth » Wed Apr 25, 07 9:43 pm

yes i did. the thing is apparently the actor is not being called? like as if it were not even in the dx.ini.

EDIT: just checked my log, as i added a log function to see if its actually getting installed, and it IS, but i get 5 Illegal Array element errors. i will post the whole summoner code.
Attachments
PortalSpawner.uc
the spawner
(2.12 KiB) Downloaded 219 times
portalcontroller.uc
the controller
(888 Bytes) Downloaded 266 times
¨‘°ºMåsåmµñ£º°‘¨
˙•●●ĊђασsΪηcǻяйαѓε●●•˙
jason.unger@gmail.com
User avatar
Ayleth
Regular
 
Posts: 313
Joined: Sun Jul 09, 06 7:27 pm
Location: 6 feet under. and trying to get out!

Postby Dae » Thu Apr 26, 07 8:00 am

I may mix something up, but aren't we disallowed to use arrays inside struct ?
User avatar
Dae
Alpha
 
Posts: 12086
Joined: Sat Sep 06, 03 4:40 pm

Postby Ayleth » Thu Apr 26, 07 8:00 pm

i did it on my admintool... well its not working here. I have abandoned the summoner for now... i will either include it in my second release, or will have it as a second package. First Release is now out.
¨‘°ºMåsåmµñ£º°‘¨
˙•●●ĊђασsΪηcǻяйαѓε●●•˙
jason.unger@gmail.com
User avatar
Ayleth
Regular
 
Posts: 313
Joined: Sun Jul 09, 06 7:27 pm
Location: 6 feet under. and trying to get out!


Return to Modifications

Who is online

Users browsing this forum: No registered users and 9 guests
cron